Class: Qwirk::Adapter::InMemory::Publisher::MyTaskProducer

Inherits:
Object
  • Object
show all
Defined in:
lib/qwirk/adapter/in_memory/publisher.rb

Instance Method Summary collapse

Constructor Details

#initialize(producer_queue, consumer_queue, marshaler, response_options) ⇒ MyTaskProducer

Returns a new instance of MyTaskProducer.



55
56
57
58
59
60
# File 'lib/qwirk/adapter/in_memory/publisher.rb', line 55

def initialize(producer_queue, consumer_queue, marshaler, response_options)
  @producer_queue   = producer_queue
  @consumer_queue   = consumer_queue
  @marshaler        = marshaler
  @response_options = response_options
end

Instance Method Details

#send(marshaled_object) ⇒ Object



62
63
64
65
66
# File 'lib/qwirk/adapter/in_memory/publisher.rb', line 62

def send(marshaled_object)
  object = @marshaler.unmarshal(marshaled_object)
  @producer_queue.write([object, @consumer_queue])
  return object.object_id
end