Skip to content

Commit

Permalink
don't wait in consume if task is done
Browse files Browse the repository at this point in the history
  • Loading branch information
KDr2 committed Mar 6, 2019
1 parent 31e624f commit 6b5a0ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/taskcopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ consume(p::Task, values...) = begin
isa(p.storage, IdDict) && haskey(p.storage, :_libtask_state) &&
(p.state = p.storage[:_libtask_state])

if p.state == :done
return p.result
end
if p.exception != nothing
throw(p.exception)
end
Expand Down

0 comments on commit 6b5a0ac

Please sign in to comment.