View Source partisan_peer_discovery_agent behaviour (partisan v5.0.0-rc.8)
This state machine is responsible for enabled cluster peers using the defined implementation backend (callback module).
Summary
Functions
In this state the agent uses the callback module to discover peers by calling its lookup/2 callback.
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()}.
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.