View Source partisan_peer_service_client (partisan v5.0.0-rc.16)

Summary

Functions

Test harness specific.

Start and link to calling process. If the process is started and can get a connection it returns {ok, pid()}. Otherwise if it fails with {error, Reason :: any()}.

Types

optional/1

-type optional(T) :: T | undefined.

state/0

-type state() ::
          #state{socket :: optional(partisan_peer_socket:t()),
                 listen_addr :: partisan:listen_addr(),
                 channel :: partisan:channel(),
                 channel_opts :: partisan:channel_opts(),
                 encoding_opts :: list(),
                 from :: pid(),
                 peer :: partisan:node_spec()}.

Functions

code_change(OldVsn, State, Extra)

-spec code_change(term() | {down, term()}, state(), term()) -> {ok, state()}.

connect(Node, Channel, ChannelOpts)

Test harness specific.

If we're running a local test, we have to use the same IP address for every bind operation, but a different port instead of the standard port.

handle_call(Event, From, State)

-spec handle_call(term(), {pid(), term()}, state()) -> {reply, term(), state()}.

handle_cast(Event, State)

-spec handle_cast(term(), state()) -> {noreply, state()}.

handle_info(Event, State0)

-spec handle_info(term(), state()) -> {noreply, state()} | {stop, normal, state()}.

init(Args)

-spec init(Args :: list()) -> {ok, state()} | {stop, Reason :: any()}.

start_link(Peer, ListenAddr, Channel, ChannelOpts, From)

-spec start_link(Peer :: partisan:node_spec(),
                 ListenAddr :: partisan:listen_addr(),
                 Channel :: partisan:channel(),
                 ChannelOpts :: partisan:channel_opts(),
                 From :: pid()) ->
                    {ok, pid()} | ignore | {error, Reason :: any()}.

Start and link to calling process. If the process is started and can get a connection it returns {ok, pid()}. Otherwise if it fails with {error, Reason :: any()}.

terminate(Reason, State)

-spec terminate(term(), state()) -> term().