Class: Pheromone::Messaging::MessageDispatcher
- Inherits:
-
Object
- Object
- Pheromone::Messaging::MessageDispatcher
- Defined in:
- lib/pheromone/messaging/message_dispatcher.rb
Instance Method Summary collapse
- #dispatch ⇒ Object
-
#initialize(message_parameters:, dispatch_method:) ⇒ MessageDispatcher
constructor
A new instance of MessageDispatcher.
Constructor Details
#initialize(message_parameters:, dispatch_method:) ⇒ MessageDispatcher
Returns a new instance of MessageDispatcher.
12 13 14 15 |
# File 'lib/pheromone/messaging/message_dispatcher.rb', line 12 def initialize(message_parameters:, dispatch_method:) = @dispatch_method = dispatch_method end |
Instance Method Details
#dispatch ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/pheromone/messaging/message_dispatcher.rb', line 17 def dispatch return unless Pheromone.enabled? if @dispatch_method == :sync .send! elsif @dispatch_method == :async end end |