View Source partisan_client_server_peer_service_manager (partisan v5.0.0-beta.15)

This module realises the partisan_peer_service_manager behaviour implementing client-server topology where clients communicate with a single server and servers form a full-mesh topology.

characteristics

Characteristics

  • Uses TCP/IP.
  • Client nodes communicate and maintain connections with server nodes. They refuse connections from other clients but refer them to a server node.
  • Server nodes communicate and maintain connections with all other server nodes.
  • Nodes periodically send heartbeat messages. The service considers a node "failed" when it misses X heartbeats.
  • Point-to-point messaging through the server (server as relay).
  • Eventually consistent membership maintained in a CRDT and replicated using gossip.
  • Scalability limited to hundres of nodes (60-200 nodes).

Link to this section Summary

Functions

Cast a message to a remote gen_server.
Cast a message to a remote gen_server.
Decode state.
Gensym support for forwarding.
Gensym support for forwarding.
Forward message to registered process on the remote side.
Return local node's view of cluster membership.
Inject a partition.
Attempt to join a remote node.
Leave the cluster.
Remove another node from the cluster.
Return membership list.
Return membership list.
Trigger function on connection close for a given node. Fun is a function object taking zero or a single argument, where the argument is the Node name.
Trigger function on connection close for a given node. Fun is a function object taking zero or a single argument, where the argument is the Node name.
Trigger function on connection open for a given node. Fun is a function object taking zero or a single argument, where the argument is the Node name.
Trigger function on connection open for a given node. Fun is a function object taking zero or a single argument, where the argument is the Node name.
Return partitions.
Receive message from a remote manager.
Reserve a slot for the particular tag.
Resolve a partition.
Send message to a remote manager.
Same as start_link([]).
Attempt to join a remote node.
Update membership.

Link to this section Types

-type membership() :: sets:set(partisan:node_spec()).
-type on_event_fun() :: partisan_peer_service_manager:on_event_fun().
-type pending() :: sets:set(partisan:node_spec()).
-type state_t() :: #state{}.
-type tag() :: atom().

Link to this section Functions

Link to this function

cast_message(Term, MEssage)

View Source
-spec cast_message(Term :: partisan_remote_ref:p() | partisan_remote_ref:n() | pid(),
             MEssage :: partisan:message()) ->
                ok.
Link to this function

cast_message(Node, ServerRef, Message)

View Source
Cast a message to a remote gen_server.
Link to this function

cast_message(Node, ServerRef, Message, Options)

View Source
Cast a message to a remote gen_server.
Decode state.
Link to this function

forward_message(Term, Message)

View Source
Gensym support for forwarding.
Link to this function

forward_message(Pid, Message, Opts)

View Source
Gensym support for forwarding.
Link to this function

forward_message(Node, ServerRef, Message, Opts)

View Source
Forward message to registered process on the remote side.
Return local node's view of cluster membership.
Link to this function

handle_call(Msg, From, State)

View Source
-spec handle_call(term(), {pid(), term()}, state_t()) -> {reply, term(), state_t()}.
-spec handle_cast(term(), state_t()) -> {noreply, state_t()}.
Link to this function

handle_info(Event, State0)

View Source
-spec init([]) -> {ok, state_t()}.
Link to this function

inject_partition(Origin, TTL)

View Source
Inject a partition.
Attempt to join a remote node.
Leave the cluster.
Remove another node from the cluster.
Return membership list.
Link to this function

members_for_orchestration()

View Source
Return membership list.
Trigger function on connection close for a given node. Fun is a function object taking zero or a single argument, where the argument is the Node name.
Link to this function

on_down(Node, Fun, Opts)

View Source
Trigger function on connection close for a given node. Fun is a function object taking zero or a single argument, where the argument is the Node name.
Trigger function on connection open for a given node. Fun is a function object taking zero or a single argument, where the argument is the Node name.
Trigger function on connection open for a given node. Fun is a function object taking zero or a single argument, where the argument is the Node name.
Return partitions.
Link to this function

receive_message(Peer, Channel, Message)

View Source
Receive message from a remote manager.
Reserve a slot for the particular tag.
Link to this function

resolve_partition(Reference)

View Source
Resolve a partition.
Link to this function

send_message(Name, Message)

View Source
Send message to a remote manager.
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.
Same as start_link([]).
Link to this function

supports_capability(Arg)

View Source
-spec supports_capability(Arg :: atom()) -> boolean().
Attempt to join a remote node.
Update membership.