~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/stdlib/doc/src/pg.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
 
3
 
 
4
<erlref>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>1996</year>
 
8
      <year>2007</year>
 
9
      <holder>Ericsson AB, All Rights Reserved</holder>
 
10
    </copyright>
 
11
    <legalnotice>
 
12
  The contents of this file are subject to the Erlang Public License,
 
13
  Version 1.1, (the "License"); you may not use this file except in
 
14
  compliance with the License. You should have received a copy of the
 
15
  Erlang Public License along with this software. If not, it can be
 
16
  retrieved online at http://www.erlang.org/.
 
17
 
 
18
  Software distributed under the License is distributed on an "AS IS"
 
19
  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
20
  the License for the specific language governing rights and limitations
 
21
  under the License.
 
22
 
 
23
  The Initial Developer of the Original Code is Ericsson AB.
 
24
    </legalnotice>
 
25
 
 
26
    <title>pg</title>
 
27
    <prepared></prepared>
 
28
    <docno></docno>
 
29
    <date></date>
 
30
    <rev></rev>
 
31
  </header>
 
32
  <module>pg</module>
 
33
  <modulesummary>Distributed, Named Process Groups</modulesummary>
 
34
  <description>
 
35
    <p>This (experimental) module implements process groups. A process
 
36
      group is a group of processes that can be accessed by a common
 
37
      name. For example, a group named <c>foobar</c> can include a set
 
38
      of processes as members of this group and they can be located on
 
39
      different nodes.</p>
 
40
    <p>When messages are sent to the named group, all members of
 
41
      the group receive the message. The messages are serialized. If
 
42
      the process <c>P1</c> sends the message <c>M1</c> to the group,
 
43
      and process <c>P2</c> simultaneously sends message <c>M2</c>, then
 
44
      all members of the group receive the two messages in the same
 
45
      order. If members of a group terminate, they are automatically 
 
46
      removed from the group.</p>
 
47
    <p>This module is not complete. The module is inspired by the ISIS
 
48
      system and the causal order protocol of the ISIS system should 
 
49
      also be implemented. At the moment, all messages are serialized
 
50
      by sending them through a group master process.</p>
 
51
  </description>
 
52
  <funcs>
 
53
    <func>
 
54
      <name>create(PgName) -> ok | {error, Reason}</name>
 
55
      <fsummary>Create an empty group</fsummary>
 
56
      <type>
 
57
        <v>PgName = term()</v>
 
58
        <v>Reason = already_created | term()</v>
 
59
      </type>
 
60
      <desc>
 
61
        <p>Creates an empty group named <c>PgName</c> on the current
 
62
          node.</p>
 
63
      </desc>
 
64
    </func>
 
65
    <func>
 
66
      <name>create(PgName, Node) -> ok | {error, Reason}</name>
 
67
      <fsummary>Create an empty group on another node</fsummary>
 
68
      <type>
 
69
        <v>PgName = term()</v>
 
70
        <v>Node = node()</v>
 
71
        <v>Reason = already_created | term()</v>
 
72
      </type>
 
73
      <desc>
 
74
        <p>Creates an empty group named <c>PgName</c> on the node
 
75
          <c>Node</c>.</p>
 
76
      </desc>
 
77
    </func>
 
78
    <func>
 
79
      <name>join(PgName, Pid) -> Members</name>
 
80
      <fsummary>Join a pid to a process group</fsummary>
 
81
      <type>
 
82
        <v>PgName = term()</v>
 
83
        <v>Pid = pid()</v>
 
84
        <v>Members = [pid()]</v>
 
85
      </type>
 
86
      <desc>
 
87
        <p>Joins the pid <c>Pid</c> to the process group <c>PgName</c>.
 
88
          Returns a list of all old members of the group.</p>
 
89
      </desc>
 
90
    </func>
 
91
    <func>
 
92
      <name>send(PgName, Msg) -> void()</name>
 
93
      <fsummary>Send a message to all members of a process group</fsummary>
 
94
      <type>
 
95
        <v>PgName = Msg = term()</v>
 
96
      </type>
 
97
      <desc>
 
98
        <p>Sends the tuple <c>{pg_message, From, PgName, Msg}</c> to
 
99
          all members of the process group <c>PgName</c>.</p>
 
100
        <p>Failure: <c>{badarg, {PgName, Msg}}</c> if <c>PgName</c> is
 
101
          not a process group (a globally registered name).</p>
 
102
      </desc>
 
103
    </func>
 
104
    <func>
 
105
      <name>esend(PgName, Msg) -> void()</name>
 
106
      <fsummary>Send a message to all members of a process group, except ourselves</fsummary>
 
107
      <type>
 
108
        <v>PgName = Msg = term()</v>
 
109
      </type>
 
110
      <desc>
 
111
        <p>Sends the tuple <c>{pg_message, From, PgName, Msg}</c> to
 
112
          all members of the process group <c>PgName</c>, except
 
113
          ourselves.</p>
 
114
        <p>Failure: <c>{badarg, {PgName, Msg}}</c> if <c>PgName</c> is
 
115
          not a process group (a globally registered name).</p>
 
116
      </desc>
 
117
    </func>
 
118
    <func>
 
119
      <name>members(PgName) -> Members</name>
 
120
      <fsummary>Return a list of all members of a process group</fsummary>
 
121
      <type>
 
122
        <v>PgName = term()</v>
 
123
        <v>Members = [pid()]</v>
 
124
      </type>
 
125
      <desc>
 
126
        <p>Returns a list of all members of the process group
 
127
          <c>PgName</c>.</p>
 
128
      </desc>
 
129
    </func>
 
130
  </funcs>
 
131
</erlref>
 
132