Class: Adaptor::ResqueAdaptor

Inherits:
LanGrove::Adaptor::Base
  • Object
show all
Defined in:
lib/adaptor/resque_adaptor.rb

Instance Method Summary collapse

Constructor Details

#initialize(root, config, deamon_name) ⇒ ResqueAdaptor

Returns a new instance of ResqueAdaptor.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/adaptor/resque_adaptor.rb', line 36

def initialize(  root, config, deamon_name )
  
  super
  
  @type = :resque_adaptor
  
  raise config_exception(

    "#{self.class} requires :queue:"

  ) if (

    config.nil? or
    
    not config.has_key?( :queue ) or
    not @queue = config[ :queue ] or
    @queue == ''

  )
  
end

Instance Method Details

#connector(params, &block) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/adaptor/resque_adaptor.rb', line 58

def connector( params, &block )
  
  #
  # This yields Resque::Job(s), 
  # one at a time, 
  # into the caller.
  #
 
  wait_for_job( @queue, &block )
  
end