Module: PgEventstore::RunnerRecoveryStrategy

Defined in:
lib/pg_eventstore/subscriptions/runner_recovery_strategy.rb

Overview

Defines an interface of a recovery strategy of the BasicRunner. See BasicRunner for an example of usage.

Instance Method Summary collapse

Instance Method Details

#recover(error) ⇒ Boolean

Actual implementation of recovery strategy. Usually you want to implement here a logic that restores from the error. The returned boolean value will be used to determine whether the runner should be restarted.

Parameters:

  • error (StandardError)

Returns:

  • (Boolean)


18
19
# File 'lib/pg_eventstore/subscriptions/runner_recovery_strategy.rb', line 18

def recover(error)
end

#recovers?(error) ⇒ Boolean

Determines whether this strategy can recover from the error. If multiple strategies can recover from the error, the first one from the :recovery_strategies array is selected.

Parameters:

  • error (StandardError)

Returns:

  • (Boolean)


11
12
# File 'lib/pg_eventstore/subscriptions/runner_recovery_strategy.rb', line 11

def recovers?(error)
end