Class: DispatchRider::Dispatcher
- Inherits:
-
Object
- Object
- DispatchRider::Dispatcher
- Extended by:
- Forwardable
- Includes:
- Callbacks::Support
- Defined in:
- lib/dispatch-rider/dispatcher.rb
Instance Attribute Summary collapse
-
#handler_registrar ⇒ Object
readonly
Returns the value of attribute handler_registrar.
Instance Method Summary collapse
- #dispatch(message) ⇒ Object
-
#initialize ⇒ Dispatcher
constructor
A new instance of Dispatcher.
Constructor Details
#initialize ⇒ Dispatcher
Returns a new instance of Dispatcher.
18 19 20 |
# File 'lib/dispatch-rider/dispatcher.rb', line 18 def initialize @handler_registrar = Registrars::Handler.new end |
Instance Attribute Details
#handler_registrar ⇒ Object (readonly)
Returns the value of attribute handler_registrar.
14 15 16 |
# File 'lib/dispatch-rider/dispatcher.rb', line 14 def handler_registrar @handler_registrar end |
Instance Method Details
#dispatch(message) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/dispatch-rider/dispatcher.rb', line 22 def dispatch() callbacks.invoke(:dispatch_message, ) do handler_registrar.fetch(.subject).new.do_process() end true # success => true (delete message) end |