This modules provides utility functions for basic load balancing based
on the scheduler id of the calling process. It is designed for use with OTP
behaviour messaging using via
names, e.g.
{via, sscheduler, {Process,...}}
. The third element, {Process,...}
, is a
tuple containing pids (pid()
) and/or process names (atom()
,
{global, any()}
, {via, module(), any()}
or {atom(), node()}
). An
element is chosen based on the scheduler id, if the element is a pid()
it
is returned, otherwise the pid()
of the process name is looked up.
{atom(), node()}
if the node is not the local node. Therefore a registered
name on another node is not supported for use with this module.
send/2 | Send a message to one element, selected based on the scheduler id, in a tuple of process names. |
whereis_name/1 | Lookup the pid or process name of one element, selected based on the scheduler id, in a tuple of process names. |
send(Processes, Msg) -> ok
Send a message to one element, selected based on the scheduler id, in a
tuple of process names. Returns ok
if the element chosen is a pid()
.
a locally registered name on another node, or a process is associated with
the name. Otherwise exits.
whereis_name(Processes) -> Process | undefined
Lookup the pid or process name of one element, selected based on the
scheduler id, in a tuple of process names. If no process is associated with
the name returns undefined
.
Generated by EDoc, Sep 29 2016, 17:17:28.