julia -t 2
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.5.3 (2020-11-09)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using WorkerUtilities
julia> WorkerUtilities.init()
julia> resp = WorkerUtilities.@spawn(sqrt(-1))
Task (failed) @0x00007f96267c5120
DomainError with -1.0:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
throw_complex_domainerror(::Symbol, ::Float64) at ./math.jl:33
sqrt at ./math.jl:573 [inlined]
sqrt(::Int64) at ./math.jl:599
(::var"#1#2")() at ./task.jl:112
julia> resp
Task (failed) @0x00007f96267c5120
DomainError with -1.0:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
throw_complex_domainerror(::Symbol, ::Float64) at ./math.jl:33
sqrt at ./math.jl:573 [inlined]
sqrt(::Int64) at ./math.jl:599
(::var"#1#2")() at ./task.jl:112
julia> resp = WorkerUtilities.@spawn(sqrt(-2))
# Takes forever...
Multiple error handling of a spawned task is currently sub optimal:
How could we assign the error to the task and
finishthe task?