Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/tapedfunction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ end
@inline val(x::TapedFunction) = x.func
@inline result(t::TapedFunction) = t.bindings[t.retval]

function (tf::TapedFunction)(args...; callback=nothing)
function (tf::TapedFunction)(args...; callback=nothing, continue=false)
if !continue # reset counter and retval to run from the start
tf.counter = 1;
tf.retval = :none;
end

# set args
if tf.counter <= 1
haskey(tf.bindings, :_1) && _update_var!(tf, :_1, tf.func)
Expand Down
2 changes: 1 addition & 1 deletion src/tapedtask.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end

function wrap_task(tf, produce_ch, consume_ch, args...)
try
tf(args...; callback=producer)
tf(args...; callback=producer, continue=true)
catch e
bt = catch_backtrace()
put!(produce_ch, TapedTaskException(e, bt))
Expand Down