View Source partisan_gen (partisan v5.0.0-beta.14)
This module is an adaptation of Erlang's gen
module which implements the really generic stuff of the generic standard behaviours (e.g. gen_server, gen_fsm).
erlang:send/2` and `erlang:monitor/2` with their Partisan counterparts. <strong>NOTICE:</strong> At the moment this only works for `partisan_pluggable_peer_service_manager
.
Link to this section Summary
Types
-type linkage() :: 'link' | 'nolink'.
Functions
Returns channel from the process dictionary
Link to this section Types
-type debug_flag() :: trace | log | statistics | debug | {logfile, string()}.
-type emgr_name() :: {local, atom()} | {global, term()} | {via, Module :: module(), Name :: term()}.
-type linkage() :: monitor | link | nolink.
-type option() :: {timeout, timeout()} | {debug, [debug_flag()]} | {hibernate_after, timeout()} | {spawn_opt, [proc_lib:spawn_option()]}.
-type options() :: [option()].
-type request_id() :: term().
-type server_ref() :: pid() | atom() | {atom(), node()} | {global, term()} | {via, module(), term()}.
-type start_ret() :: {ok, pid()} | {ok, {pid(), reference()}} | ignore | {error, term()}.
Link to this section Functions
-spec check_response(RequestId :: term(), Key :: request_id()) -> {reply, Reply :: term()} | no_reply | {error, {term(), server_ref()}}.
-spec receive_response(RequestId :: request_id(), timeout()) -> {reply, Reply :: term()} | timeout | {error, {term(), server_ref()}}.
-spec send_request(Name :: server_ref(), Label :: term(), Request :: term()) -> request_id().
-spec wait_response(RequestId :: request_id(), timeout()) -> {reply, Reply :: term()} | timeout | {error, {term(), server_ref()}}.