Class: Announcer::Publishers::AsyncResquePublisher::PublisherWorker

Inherits:
Object
  • Object
show all
Includes:
Celluloid
Defined in:
lib/announcer/publishers/async_resque_publisher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#publisherObject (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