@@ -106,7 +106,7 @@ defmodule Task.Supervisor do
106106 """
107107 @ spec async_nolink ( Supervisor . supervisor , module , atom , [ term ] ) :: Task . t
108108 def async_nolink ( supervisor , module , fun , args ) do
109- do_async ( supervisor , :monitor , module , fun , args )
109+ do_async ( supervisor , :nolink , module , fun , args )
110110 end
111111
112112 @ doc """
@@ -181,7 +181,7 @@ defmodule Task.Supervisor do
181181 Enumerable . t
182182 def async_stream_nolink ( supervisor , enumerable , module , function , args , options \\ [ ] )
183183 when is_atom ( module ) and is_atom ( function ) and is_list ( args ) do
184- build_stream ( supervisor , :monitor , enumerable , { module , function , args } , options )
184+ build_stream ( supervisor , :nolink , enumerable , { module , function , args } , options )
185185 end
186186
187187 @ doc """
@@ -197,7 +197,7 @@ defmodule Task.Supervisor do
197197 @ spec async_stream_nolink ( Supervisor . supervisor , Enumerable . t , ( term -> term ) , Keyword . t ) ::
198198 Enumerable . t
199199 def async_stream_nolink ( supervisor , enumerable , fun , options \\ [ ] ) when is_function ( fun , 1 ) do
200- build_stream ( supervisor , :monitor , enumerable , fun , options )
200+ build_stream ( supervisor , :nolink , enumerable , fun , options )
201201 end
202202
203203 @ doc """
@@ -250,20 +250,20 @@ defmodule Task.Supervisor do
250250
251251 defp do_async ( supervisor , link_type , module , fun , args ) do
252252 owner = self ( )
253- args = [ owner , link_type , get_info ( owner ) , { module , fun , args } ]
253+ args = [ owner , :monitor , get_info ( owner ) , { module , fun , args } ]
254254 { :ok , pid } = Supervisor . start_child ( supervisor , args )
255255 if link_type == :link , do: Process . link ( pid )
256256 ref = Process . monitor ( pid )
257257 send pid , { owner , ref }
258258 % Task { pid: pid , ref: ref , owner: owner }
259259 end
260260
261- defp build_stream ( supervisor , type , enumerable , fun , options ) do
261+ defp build_stream ( supervisor , link_type , enumerable , fun , options ) do
262262 & Task.Supervised . stream ( enumerable , & 1 , & 2 , fun , options , fn owner , mfa ->
263- args = [ owner , type , get_info ( owner ) , mfa ]
263+ args = [ owner , :monitor , get_info ( owner ) , mfa ]
264264 { :ok , pid } = Supervisor . start_child ( supervisor , args )
265- if type == :link , do: Process . link ( pid )
266- { type , pid }
265+ if link_type == :link , do: Process . link ( pid )
266+ { link_type , pid }
267267 end )
268268 end
269269end
0 commit comments