55
55
error_msg("No master node given to slave:pseudo/1~n",[]).
57
-spec pseudo(Master, ServerList) -> ok when
59
ServerList :: [atom()].
57
61
pseudo(_, []) -> ok;
58
62
pseudo(Master, [S|Tail]) ->
59
63
start_pseudo(S, whereis(S), Master),
69
73
%% This relay can be used to relay all messages directed to a process.
75
-spec relay(Pid) -> no_return() when
71
78
relay({badrpc,Reason}) ->
72
79
error_msg(" ** exiting relay server ~w :~w **~n", [self(),Reason]),
120
127
%% {error, no_rsh} |
121
128
%% {error, {already_running, Name@Host}}
130
-spec start(Host) -> {ok, Node} | {error, Reason} when
133
Reason :: timeout | no_rsh | {already_running, Node}.
124
136
L = atom_to_list(node()),
125
137
Name = upto($@, L),
138
start(Host, Name, [], no_link).
140
-spec start(Host, Name) -> {ok, Node} | {error, Reason} when
144
Reason :: timeout | no_rsh | {already_running, Node}.
128
146
start(Host, Name) ->
129
147
start(Host, Name, []).
149
-spec start(Host, Name, Args) -> {ok, Node} | {error, Reason} when
154
Reason :: timeout | no_rsh | {already_running, Node}.
131
156
start(Host, Name, Args) ->
132
157
start(Host, Name, Args, no_link).
159
-spec start_link(Host) -> {ok, Node} | {error, Reason} when
162
Reason :: timeout | no_rsh | {already_running, Node}.
134
164
start_link(Host) ->
135
165
L = atom_to_list(node()),
136
166
Name = upto($@, L),
137
start_link(Host, Name).
167
start(Host, Name, [], self()).
169
-spec start_link(Host, Name) -> {ok, Node} | {error, Reason} when
173
Reason :: timeout | no_rsh | {already_running, Node}.
139
175
start_link(Host, Name) ->
140
176
start_link(Host, Name, []).
178
-spec start_link(Host, Name, Args) -> {ok, Node} | {error, Reason} when
183
Reason :: timeout | no_rsh | {already_running, Node}.
142
185
start_link(Host, Name, Args) ->
143
186
start(Host, Name, Args, self()).
164
207
%% Stops a running node.
209
-spec stop(Node) -> ok when
167
213
% io:format("stop(~p)~n", [Node]),
168
214
rpc:call(Node, erlang, halt, []),