RpcLoadBalancer.LoadBalancer.Pg (rpc_load_balancer v0.3.0)

Copy Markdown View Source

Wrapper around :pg used by RpcLoadBalancer.LoadBalancer.

Encapsulates the shared :pg group name and the patterns for reading membership and fanning out RPC calls to remote members.

Summary

Functions

Runs :erpc.multicall/5 against every remote member of the group and returns [{remote_node, result}] pairs in membership order.

Returns remote node names (non-local, deduplicated) registered for the given load balancer.

Functions

child_spec(opts)

@spec child_spec(any()) :: map()

multicall(load_balancer_name, module, fun, args, timeout)

@spec multicall(atom() | module(), module(), atom(), [any()], timeout()) :: [
  {node(), any()}
]

Runs :erpc.multicall/5 against every remote member of the group and returns [{remote_node, result}] pairs in membership order.

Empty-membership shortcut: returns [] without invoking :erpc.

pg_group_name()

@spec pg_group_name() :: atom()

remote_members(load_balancer_name)

@spec remote_members(atom() | module()) :: [node()]

Returns remote node names (non-local, deduplicated) registered for the given load balancer.

start_link(opts \\ [])

@spec start_link(any()) :: {:ok, pid()} | {:error, any()}