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).

It replaces all instances of 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

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 linkage() :: '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

Link to this function

call(Process, Label, Request)

View Source
Link to this function

call(Process, Label, Request, Timeout)

View Source
Link to this function

check_response(RequestId, Key)

View Source
-spec check_response(RequestId :: term(), Key :: request_id()) ->
                  {reply, Reply :: term()} | no_reply | {error, {term(), server_ref()}}.
Link to this function

debug_options(Name, Opts)

View Source
Link to this function

format_status_header(TagLine, Pid)

View Source
Returns channel from the process dictionary
Link to this function

hibernate_after(Options)

View Source
Link to this function

init_it(GenMod, Starter, Parent, Mod, Args, Options)

View Source
Link to this function

init_it(GenMod, Starter, Parent, Name, Mod, Args, Options)

View Source
Link to this function

receive_response(RequestId, Timeout)

View Source
-spec receive_response(RequestId :: request_id(), timeout()) ->
                    {reply, Reply :: term()} | timeout | {error, {term(), server_ref()}}.
Link to this function

send_request(Name, Label, Request)

View Source
-spec send_request(Name :: server_ref(), Label :: term(), Request :: term()) -> request_id().
Link to this function

start(GenMod, LinkP, Mod, Args, Options)

View Source
-spec start(module(), linkage(), module(), term(), options()) -> start_ret().
Link to this function

start(GenMod, LinkP, Name, Mod, Args, Options)

View Source
-spec start(module(), linkage(), emgr_name(), module(), term(), options()) -> start_ret().
Link to this function

stop(Process, Reason, Timeout)

View Source
Link to this function

wait_response(RequestId, Timeout)

View Source
-spec wait_response(RequestId :: request_id(), timeout()) ->
                 {reply, Reply :: term()} | timeout | {error, {term(), server_ref()}}.