MCPcopy Create free account
hub / github.com/apple/foundationdb / queue_test

Function queue_test

layers/containers/highcontention/queue.py:293–312  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

291
292
293def queue_test(db):
294 queue = Queue(Subspace(('queue_test',)), False)
295 print 'Clear Queue'
296 queue.clear(db)
297 print 'Empty? %s' % queue.empty(db)
298 print 'Push 10, 8, 6'
299 queue.push(db, 10)
300 queue.push(db, 8)
301 queue.push(db, 6)
302 print 'Empty? %s' % queue.empty(db)
303 print 'Pop item: %d' % queue.pop(db)
304 print 'Next item: %d' % queue.peek(db)
305 print 'Pop item: %d' % queue.pop(db)
306 print 'Pop item: %d' % queue.pop(db)
307 print 'Empty? %s' % queue.empty(db)
308 print 'Push 5'
309 queue.push(db, 5)
310 print 'Clear Queue'
311 queue.clear(db)
312 print 'Empty? %s' % queue.empty(db)
313
314
315######################

Callers

nothing calls this directly

Calls 7

clearMethod · 0.95
emptyMethod · 0.95
pushMethod · 0.95
popMethod · 0.95
peekMethod · 0.95
QueueClass · 0.70
SubspaceClass · 0.70

Tested by

no test coverage detected