Class: Announcer::Publishers::AsyncResquePublisher::PublisherWorker
- Inherits:
-
Object
- Object
- Announcer::Publishers::AsyncResquePublisher::PublisherWorker
- Includes:
- Celluloid
- Defined in:
- lib/announcer/publishers/async_resque_publisher.rb
Instance Attribute Summary collapse
-
#publisher ⇒ Object
readonly
Returns the value of attribute publisher.
Instance Method Summary collapse
-
#initialize(publisher) ⇒ PublisherWorker
constructor
A new instance of PublisherWorker.
- #publish(event) ⇒ Object
Constructor Details
#initialize(publisher) ⇒ PublisherWorker
Returns a new instance of PublisherWorker.
66 67 68 |
# File 'lib/announcer/publishers/async_resque_publisher.rb', line 66 def initialize(publisher) @publisher = publisher end |
Instance Attribute Details
#publisher ⇒ Object (readonly)
Returns the value of attribute publisher.
64 65 66 |
# File 'lib/announcer/publishers/async_resque_publisher.rb', line 64 def publisher @publisher end |
Instance Method Details
#publish(event) ⇒ Object
70 71 72 73 74 75 76 77 |
# File 'lib/announcer/publishers/async_resque_publisher.rb', line 70 def publish(event) publisher.resque.enqueue_to( publisher.config.publisher_queue.to_sym, ResquePublisher::PublisherJob, event.serialize, :async_resque ) end |