Class: ActiveMessaging::Worker
- Inherits:
-
Object
- Object
- ActiveMessaging::Worker
- Includes:
- Celluloid
- Defined in:
- lib/activemessaging/threaded_poller.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#poller ⇒ Object
Returns the value of attribute poller.
Instance Method Summary collapse
- #execute(message) ⇒ Object
-
#initialize(poller, options) ⇒ Worker
constructor
A new instance of Worker.
- #logger ⇒ Object
Constructor Details
#initialize(poller, options) ⇒ Worker
Returns a new instance of Worker.
189 190 191 192 |
# File 'lib/activemessaging/threaded_poller.rb', line 189 def initialize(poller, ) self.poller = poller self. = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
187 188 189 |
# File 'lib/activemessaging/threaded_poller.rb', line 187 def @options end |
#poller ⇒ Object
Returns the value of attribute poller.
187 188 189 |
# File 'lib/activemessaging/threaded_poller.rb', line 187 def poller @poller end |
Instance Method Details
#execute(message) ⇒ Object
194 195 196 197 198 199 200 201 202 |
# File 'lib/activemessaging/threaded_poller.rb', line 194 def execute() begin ::ActiveMessaging::Gateway.dispatch() ensure ::ActiveRecord::Base.clear_active_connections! if defined?(::ActiveRecord) end poller.executed!(current_actor) end |
#logger ⇒ Object
204 |
# File 'lib/activemessaging/threaded_poller.rb', line 204 def logger; ::ActiveMessaging.logger; end |