blob: aa1ea7ef8d0363cea02f732ae2f853b4bf99a4f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
[;1m-spec register(RegName, PidOrPort) -> true[0m
[;1m when RegName :: atom(), PidOrPort :: port() | pid().[0m
Associates the name [;;4mRegName[0m with a process identifier (pid) or a
port identifier. [;;4mRegName[0m, which must be an atom, can be used
instead of the pid or port identifier in send operator ([;;4mRegName ![0m
[;;4mMessage[0m). Example:
> register(db, Pid).
true
Failures:
[;;4m[;;4mbadarg[0m[0m:
If [;;4mPidOrPort[0m is not an existing local process or port.
[;;4m[;;4mbadarg[0m[0m:
If [;;4mRegName[0m is already in use.
[;;4m[;;4mbadarg[0m[0m:
If the process or port is already registered (already has a
name).
[;;4m[;;4mbadarg[0m[0m:
If [;;4mRegName[0m is the atom [;;4mundefined[0m.
|