View Source partisan_peer_discovery_agent behaviour (partisan v5.0.0-rc.1)
This state machine is responsible for enabled cluster peers using the defined implementation backend (callback module).
Link to this section Summary
Functions
In this state the agent uses the callback module to discover peers by calling its lookup/2 callback.
Link to this section Callbacks
-callback init(Opts :: map()) -> {ok, State :: any()} | {error, Reason :: any()}.
-callback lookup(State :: any(), Timeout :: timeout()) -> {ok, [partisan:node_spec()], NewState :: any()} | {error, Reason :: any(), NewState :: any()}.
Link to this section Functions
-spec disable() -> ok.
-spec enable() -> ok.
-spec start() -> {ok, pid()} | ignore | {error, term()}.
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.
-spec status() -> enabled | disabled.