View Source Cloister.Listener behaviour (cloister v0.18.1)

The behavior to be implemented by Cloister.Monitor listeners.

Summary

Callbacks

Passed to the Cloister.Monitor.start_link/1 and is being called on each subsequent monitored node state change.

Callbacks

Link to this callback

on_state_change(from, to, state)

View Source
@callback on_state_change(
  from :: Cloister.Monitor.Fsm.state(),
  to :: Cloister.Monitor.Fsm.state(),
  state :: Cloister.Monitor.t()
) :: :ok

Passed to the Cloister.Monitor.start_link/1 and is being called on each subsequent monitored node state change.

Listeners are obliged to handle :up, :rehashing and :stopping events.

Please note, that since v0.18.0, the interface has changed to include the state to. Consumers need to update their code because in v1.0.0 the obsoleted callback on_state_change/2 will be removed.