Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
pg(3)			   Erlang Module Definition			 pg(3)

NAME
       pg - Distributed, Named Process Groups

DESCRIPTION
   Warning:
       This module is deprecated and will be removed in	Erlang/OTP 18.

       This  (experimental)  module implements process groups. A process group
       is a group of processes that can	be accessed by a common	name. For  ex-
       ample,  a  group	named foobar can include a set of processes as members
       of this group and they can be located on	different nodes.

       When messages are sent to the named group, all members of the group re-
       ceive the message. The messages are serialized. If the process P1 sends
       the message M1 to the group, and	process	P2 simultaneously  sends  mes-
       sage  M2, then all members of the group receive the two messages	in the
       same order. If members of a group terminate, they are automatically re-
       moved from the group.

       This  module is not complete. The module	is inspired by the ISIS	system
       and the causal order protocol of	the ISIS system	should also be	imple-
       mented.	At  the	 moment,  all  messages	are serialized by sending them
       through a group master process.

EXPORTS
       create(PgName) -> ok | {error, Reason}

	      Types:

		 PgName	= term()
		 Reason	= already_created | term()

	      Creates an empty group named PgName on the current node.

       create(PgName, Node) -> ok | {error, Reason}

	      Types:

		 PgName	= term()
		 Node =	node()
		 Reason	= already_created | term()

	      Creates an empty group named PgName on the node Node.

       join(PgName, Pid) -> Members

	      Types:

		 PgName	= term()
		 Pid = pid()
		 Members = [pid()]

	      Joins the	pid Pid	to the process group PgName. Returns a list of
	      all old members of the group.

       send(PgName, Msg) -> ok

	      Types:

		 PgName	= Msg =	term()

	      Sends  the  tuple	{pg_message, From, PgName, Msg}	to all members
	      of the process group PgName.

	      Failure: {badarg,	{PgName, Msg}} if  PgName  is  not  a  process
	      group (a globally	registered name).

       esend(PgName, Msg) -> ok

	      Types:

		 PgName	= Msg =	term()

	      Sends  the  tuple	{pg_message, From, PgName, Msg}	to all members
	      of the process group PgName, except ourselves.

	      Failure: {badarg,	{PgName, Msg}} if  PgName  is  not  a  process
	      group (a globally	registered name).

       members(PgName) -> Members

	      Types:

		 PgName	= term()
		 Members = [pid()]

	      Returns a	list of	all members of the process group PgName.

Ericsson AB			  stdlib 2.4				 pg(3)

NAME | DESCRIPTION | EXPORTS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=pg&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help