Skip to content

Commit 85fce7a

Browse files
author
José Valim
committed
Fix delegations in Node.ex (ht @yrashk)
1 parent fc76de1 commit 85fce7a

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

lib/elixir/lib/node.ex

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,46 @@ defmodule Node do
7373
Returns the pid of a new process started by the application of `fun`
7474
on `node`. If `node` does not exist, a useless pid is returned.
7575
76-
Check http://www.erlang.org/doc/man/erlang.html#spawn_opt-4 for
76+
Check http://www.erlang.org/doc/man/erlang.html#spawn-2 for
7777
the list of available options.
7878
"""
79-
def spawn(node, fun, opts // []) do
79+
def spawn(node, fun) do
80+
:erlang.spawn(node, fun)
81+
end
82+
83+
@doc """
84+
Returns the pid of a new process started by the application of `fun`
85+
on `node`. If `node` does not exist, a useless pid is returned.
86+
87+
Check http://www.erlang.org/doc/man/erlang.html#spawn_opt-3 for
88+
the list of available options.
89+
"""
90+
def spawn(node, fun, opts) do
8091
:erlang.spawn_opt(node, fun, opts)
8192
end
8293

8394
@doc """
8495
Returns the pid of a new process started by the application of
85-
`module.function(args)` on `node`. If `node` does not exists, a useless
86-
pid is returned.
96+
`module.function(args)` on `node`. If `node` does not exists,
97+
a useless pid is returned.
98+
99+
Check http://www.erlang.org/doc/man/erlang.html#spawn-4 for
100+
the list of available options.
101+
"""
102+
def spawn(node, module, fun, args) do
103+
:erlang.spawn(node, module, fun, args)
104+
end
105+
106+
@doc """
107+
Returns the pid of a new process started by the application of
108+
`module.function(args)` on `node`. If `node` does not exists,
109+
a useless pid is returned.
87110
88-
Check http://www.erlang.org/doc/man/erlang.html#spawn_opt-4 for
111+
Check http://www.erlang.org/doc/man/erlang.html#spawn_opt-5 for
89112
the list of available options.
90113
"""
91-
def spawn(node, module, fun, args, opts // []) do
92-
:erlang.spawn(node, module, fun, args, opts)
114+
def spawn(node, module, fun, args, opts) do
115+
:erlang.spawn_opt(node, module, fun, args, opts)
93116
end
94117

95118
@doc """

0 commit comments

Comments
 (0)