JuliaDynamics / ResumableFunctions.jl

C# style generators a.k.a. semi-coroutines for Julia.
Other
160 stars 19 forks source link

Resumable function has stopped #52

Open hdavid16 opened 3 years ago

hdavid16 commented 3 years ago

What causes this error? I am trying to interrupt a process in SimJulia using SimJulia.interrupt

ERROR: @resumable function has stopped!
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] (::ProcessSim.var"##312")(::Nothing) at C:\Users\HD\.julia\packages\ResumableFunctions\n1hTu\src\macro.jl:88
 [3] execute(::SimJulia.Put, ::Process) at C:\Users\HD\.julia\packages\SimJulia\alkAr\src\processes.jl:32
 [4] (::SimJulia.var"#1#2"{typeof(SimJulia.execute),SimJulia.Put,Tuple{Process}})() at C:\Users\HD\.julia\packages\SimJulia\alkAr\src\base.jl:51 

Also, is there a way to know which resumable function stopped? I have nested processes.

BenLauwens commented 3 years ago

I can return also the name of the @resumable function, the instance of the process is not known. Does this help?

hdavid16 commented 3 years ago

Yes. That would be helpful when debugging. Thanks

MarkNahabedian commented 1 week ago

I see this error if I pass a ResumableFunctions iterator as the first value of Base.intersect:

using ResumableFunctions

@resumable function onetwothree()
    @yield 1
    @yield 2
    @yield 3
end

intersect(onetwothree(), [2])

ERROR: @resumable function has stopped!
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35

If there's isn't already an issue for this, I'll open one.

Krastanov commented 1 week ago

for future reference, this is now reported in #107