class Synapse::Command::RetryScheduler

Represents a mechanism that decides whether or not to dispatch a command when previous attempts resulted in an exception being raised.

@abstract

Public Instance Methods

schedule(command, failures, dispatcher) click to toggle source

Inspects the given command message that failed due to an exception

The given list of failures contains exceptions that have occured each time the command was dispatched by the command bus. It includes the most recent failure at the end of the list.

The return value of this method indicates whether or not the command has been scheduled for a retry. If it has, the callback for the command should not be invoked. Otherwise, the failure will be interpreted as terminal and the callback will be invoked with the last recorded failure.

@abstract @param [CommandMessage] command @param [Array<Exception>] failures @param [Proc] dispatcher @return [Boolean]

# File lib/synapse/command/gateway/retry_scheduler.rb, line 24
def schedule(command, failures, dispatcher)
  raise NotImplementedError
end