aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/InMem/Queue.yqls
blob: 2589942a60fd0a4bb204144ec37c277b08767c0b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(
(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))

(let res_sink (DataSink 'result))

(let queue (QueueCreate (DataType 'Uint32) (Uint64 '4) (Uint64 '2)))

(let queue (QueuePush queue (Int32 '1)))
(let queue (QueuePush queue (Int32 '2)))

(let result '((QueuePeek queue (Uint64 '0)) (QueuePeek queue (Uint64 '1)) (QueuePeek queue (Uint64 '2)) (QueuePeek queue (Uint64 '3))))
(let world (Write! world res_sink (Key) result '('('type))))

(let queue (QueuePop queue))
(let queue (QueuePop queue))
(let queue (QueuePush queue (Int32 '3)))

(let result '((QueuePeek queue (Uint64 '0)) (QueuePeek queue (Uint64 '1)) (QueuePeek queue (Uint64 '2)) (QueuePeek queue (Uint64 '3))))
(let world (Write! world res_sink (Key) result '('('type))))

(let world (Commit! world res_sink))
(return world)

)