Module partisan_util

Data Types

channel()

channel() = atom()

listen_addr()

listen_addr() = #{ip => inet:ip_address(), port => non_neg_integer()}

node_spec()

node_spec() = #{name => node(), listen_addrs => [listen_addr()], channels => [channel()], parallelism => non_neg_integer()}

Function Index

build_tree/3Convert a list of elements into an N-ary tree.
dispatch_pid/1Return a pid to use for message dispatch.
dispatch_pid/2Return a pid to use for message dispatch.
dispatch_pid/3Return a pid to use for message dispatch for a given channel.
may_disconnect/2
maybe_connect/2Create a new connection to a node and return a new dictionary with the associated connect pid.
term_to_iolist/1

Function Details

build_tree/3

build_tree(N::integer(), Nodes::[term()], Opts::[term()]) -> orddict:orddict()

Convert a list of elements into an N-ary tree. This conversion works by treating the list as an array-based tree where, for example in a binary 2-ary tree, a node at index i has children 2i and 2i+1. The conversion also supports a "cycles" mode where the array is logically wrapped around to ensure leaf nodes also have children by giving them backedges to other elements.

dispatch_pid/1

dispatch_pid(Entries) -> any()

Return a pid to use for message dispatch.

dispatch_pid/2

dispatch_pid(Channel, Entries) -> any()

Return a pid to use for message dispatch.

dispatch_pid/3

dispatch_pid(PartitionKey, Channel, Entries) -> any()

Return a pid to use for message dispatch for a given channel.

may_disconnect/2

may_disconnect(NodeName, Connections) -> any()

maybe_connect/2

maybe_connect(Node::node_spec(), Connections::partisan_peer_service_connections:t()) -> partisan_peer_service_connections:t()

Create a new connection to a node and return a new dictionary with the associated connect pid

Function should enforce the invariant that all cluster members are keys in the dict pointing to empty list if they are disconnected or a socket pid if they are connected.

term_to_iolist/1

term_to_iolist(Term) -> any()


Generated by EDoc