View Source partisan_peer_discovery_agent behaviour (partisan v5.0.0-beta.21)

This state machine is responsible for enabled cluster peers using the defined implementation backend (callback module).

Link to this section Summary

Link to this section Types

Link to this section Callbacks

-callback init(Opts :: map()) -> {ok, State :: any()} | {error, Reason :: any()}.
-callback lookup(State :: any(), Timeout :: timeout()) ->
          {ok, [peer()], NewState :: any()} | {error, Reason :: any(), NewState :: any()}.

Link to this section Functions

Link to this function

code_change(OldVsn, StateName, State, Extra)

View Source
-spec disable() -> boolean().
Link to this function

disabled(EventType, EventContent, State)

View Source
-spec enable() -> boolean().
Link to this function

enabled(EventType, EventContent, State)

View Source
In this state the agent uses the callback module to discover peers by calling its lookup/2 callback.
-spec start() -> {ok, pid()} | ignore | {error, term()}.
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.
-spec status() -> enabled | disabled.
Link to this function

terminate(Reason, StateName, State)

View Source