Class: Proxy::RemoteExecution::Ssh::MQTT::DispatcherSupervisor
- Inherits:
-
Concurrent::Actor::RestartingContext
- Object
- Concurrent::Actor::RestartingContext
- Proxy::RemoteExecution::Ssh::MQTT::DispatcherSupervisor
- Defined in:
- lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb
Instance Method Summary collapse
-
#behaviour_definition ⇒ Object
In case an exception is raised during processing, instruct concurrent-ruby to keep going without losing state.
-
#initialize ⇒ DispatcherSupervisor
constructor
A new instance of DispatcherSupervisor.
- #on_message(message) ⇒ Object
Constructor Details
#initialize ⇒ DispatcherSupervisor
Returns a new instance of DispatcherSupervisor.
6 7 8 9 10 11 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 6 def initialize limit = Proxy::RemoteExecution::Ssh::Plugin.settings[:mqtt_rate_limit] @dispatcher = DispatcherActor.spawn('MQTT dispatcher', Proxy::Dynflow::Core.world.clock, limit) end |
Instance Method Details
#behaviour_definition ⇒ Object
In case an exception is raised during processing, instruct concurrent-ruby to keep going without losing state
26 27 28 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 26 def behaviour_definition Concurrent::Actor::Behaviour.restarting_behaviour_definition(:resume!) end |
#on_message(message) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 13 def () case when :dispatcher_reference @dispatcher when :resumed # Carry on else pass end end |