Class: Synapse::Command::CommandCallback Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse/command/command_callback.rb

Overview

This class is abstract.

Callback that is notified of the outcome of the dispatch of a command

Direct Known Subclasses

FutureCallback, RetryingCallback, VoidCallback

Instance Method Summary collapse

Instance Method Details

#on_failure(exception) ⇒ undefined

This method is abstract.

Called when a dispatch fails due to an exception

Parameters:

  • exception (Exception)

    The cause of the failure

Returns:

  • (undefined)

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/synapse/command/command_callback.rb', line 20

def on_failure(exception)
  raise NotImplementedError
end

#on_success(result) ⇒ undefined

This method is abstract.

Called when a dispatch is successful

Parameters:

  • result (Object)

    The result from the command handler

Returns:

  • (undefined)

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/synapse/command/command_callback.rb', line 11

def on_success(result)
  raise NotImplementedError
end