Sha256: bf2036597c86f09cc6f81aa68e5ed00552efdba4ed0585cd8d7ac0fe0130b0ca

Contents?: true

Size: 829 Bytes

Versions: 2

Compression:

Stored size: 829 Bytes

Contents

require 'bluth'
require 'bluth/test_helpers'

#Familia.debug = true

## Can enqueue a job
@job = ExampleHandler.enqueue :arg1 => :val1
@job.class
#=> Bluth::Gob

## Job knows it's on critical queue
@job.current_queue
#=> :critical

## Job knows it's handler
@job.handler
#=> ExampleHandler

## Bluth::Critical has job id
Bluth::Queue.critical.range.member? @job.jobid
#=> true

## Can fetch a job from queue
@gobid = Bluth::Queue.critical.pop
#=> @job.jobid

## Create Gob
@popped_job = Bluth::Gob.from_redis @gobid
@popped_job.jobid
#=> @job.jobid

## Popped job has args
@popped_job.data['arg1']
#=> 'val1'

## Popped job is still critical
@popped_job.current_queue
#=> :critical

## Move job to another queue
@popped_job.running!
#=> true

## Popped job is still critical
@popped_job.current_queue
#=> :running


@job.destroy!

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bluth-0.7.2 try/17_gob_try.rb
bluth-0.7.0 try/17_gob_try.rb