You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> @tasksfor i in1:10
if true
@one_by_one begin
println(i)
sleep(0.1)
end
end
end
ERROR: LoadError: The @one_by_one macro may only be used inside of a @tasks block.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] var"@one_by_one"(__source__::LineNumberNode, __module__::Module, args::Vararg{Any})
@ OhMyThreads ~/.julia/packages/OhMyThreads/20X0i/src/macros.jl:207
in expression starting at REPL[2]:3
Currently the @tasks macro needs to see @one_by_one directly, but logically speaking this is not necessary
The text was updated successfully, but these errors were encountered:
We only cared about “top-level” (relative to @tasks) because we started with @set and @local and those only make sense there. Supporting @one_by_one in (potentially nested) if(s) is harder than I thought. It doesn’t fit into the scheme we currently use to find and replace those macros.
As a workaround you can use:
julia> @tasksfor i in1:10
if true
lock(lck) do
println(i)
sleep(0.1)
end
end
end
3
10
7
9
5
6
4
8
1
2
Currently the
@tasks
macro needs to see@one_by_one
directly, but logically speaking this is not necessaryThe text was updated successfully, but these errors were encountered: