@@ -207,26 +207,27 @@ worker_timeout() = parse(Float64, get(ENV, "JULIA_WORKER_TIMEOUT", "60.0"))
207
207
208
208
# # worker creation and setup ##
209
209
"""
210
- start_worker([out::IO=stdout], cookie::AbstractString=readline(stdin))
210
+ start_worker([out::IO=stdout], cookie::AbstractString=readline(stdin); close_stdin::Bool=true, stderr_to_stdout::Bool=true )
211
211
212
212
`start_worker` is an internal function which is the default entry point for
213
213
worker processes connecting via TCP/IP. It sets up the process as a Julia cluster
214
214
worker.
215
215
216
216
host:port information is written to stream `out` (defaults to stdout).
217
217
218
- The function closes stdin (after reading the cookie if required), redirects stderr to stdout,
219
- listens on a free port (or if specified, the port in the `--bind-to` command
220
- line option) and schedules tasks to process incoming TCP connections and requests.
218
+ The function reads the cookie from stdin if required, and listens on a free port
219
+ (or if specified, the port in the `--bind-to` command line option) and schedules
220
+ tasks to process incoming TCP connections and requests. It also (optionally)
221
+ closes stdin and redirects stderr to stdout.
221
222
222
223
It does not return.
223
224
"""
224
- start_worker (cookie:: AbstractString = readline (stdin )) = start_worker (stdout , cookie)
225
- function start_worker (out:: IO , cookie:: AbstractString = readline (stdin ))
225
+ start_worker (cookie:: AbstractString = readline (stdin ); kwargs ... ) = start_worker (stdout , cookie; kwargs ... )
226
+ function start_worker (out:: IO , cookie:: AbstractString = readline (stdin ); close_stdin :: Bool = true , stderr_to_stdout :: Bool = true )
226
227
init_multi ()
227
228
228
- close (stdin ) # workers will not use it
229
- redirect_stderr (stdout )
229
+ close_stdin && close (stdin ) # workers will not use it
230
+ stderr_to_stdout && redirect_stderr (stdout )
230
231
231
232
init_worker (cookie)
232
233
interface = IPv4 (LPROC. bind_addr)
0 commit comments