class Proxy::RemoteExecution::Ssh::MQTT::DispatcherSupervisor

Public Class Methods

new() click to toggle source
# 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

Public Instance Methods

behaviour_definition() click to toggle source

In case an exception is raised during processing, instruct concurrent-ruby to keep going without losing state

# 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) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb, line 13
def on_message(message)
  case message
  when :dispatcher_reference
    @dispatcher
  when :resumed
    # Carry on
  else
    pass
  end
end