Sha256: 48515ed34b78099e1c887c93c7633e34c42bae4d9cc04380a6a9c1f88f1fcfa3

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

require 'bluth'
require 'bluth/test_helpers'

#Familia.debug = true

ExampleHandler.enqueue :item => :val1
ExampleHandler.enqueue :item => :val2
ExampleHandler.enqueue :item => :val3


## Critical queue should have 3 items
Bluth::Queue.critical.size
#=> 3

## Can set poptimeout
Bluth.poptimeout = 2
#=> 2

## Bluth.shift returns first value
@job1 = Bluth.shift
@job1.data['item']
#=> 'val1'

## Bluth.pop returns last value
@job2 = Bluth.pop
@job2.data['item']
#=> 'val3'

## Bluth.pop returns remaining value
@job3 = Bluth.pop
@job3.data['item']
#=> 'val2'

## Bluth.pop returns nil after waiting for poptimeout
Bluth.pop
#=> nil

Bluth::Queue.critical.clear
@job1.destroy! if @job1
@job2.destroy! if @job2
@job3.destroy! if @job3

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bluth-0.6.1 try/19_bluth_try.rb
bluth-0.6.0 try/19_bluth_try.rb