Class: Qup::Producer

Inherits:
Object
  • Object
show all
Defined in:
lib/qup/producer.rb

Overview

Public: Produces items for a queue

Examples:

producer = queue.producer
producer.produce( my_message )

Instance Method Summary collapse

Constructor Details

#initialize(queue) ⇒ Producer

Public: Create a new Producer

queue - the Queue this producer is for

Returns a new Producer



15
16
17
# File 'lib/qup/producer.rb', line 15

def initialize( queue )
  @queue = queue
end

Instance Method Details

#produce(message) ⇒ Object

Public: Produce a message for the queue

message - the Object to put onto the queue

Returns nothing.



24
25
26
# File 'lib/qup/producer.rb', line 24

def produce( message )
  @queue.produce( message )
end