This is a system to allow the convenient handling of coros.
It adresses a problem where stopping and resuming a coroutine by directly accessing it would fail, because it has produced a child and is not actually running.
This is the case for calling on the actorCoroutine while the actor is executing a method, when the coroutine is currently in exception handling code or when the stack of a coro has become to large.
Usage is as follows.
o := Object clone
o l := method(
j := 1
writeln("object: " .. j)
if( j%2==0, "object will pause now\n" print;pause) //will access the actorCoro offspring implicitly through currentCoroutine
j = j + 1
run := method(
writeln("i: " .. i)
if(i==2, o actorCoroutine recentInChain resumeLater; "\nobject should resume now\n" print) //here its resumed explicitly
Made changes in the Io layer to support recentInChain.
Finished header modification and new functions/methods declaration.
Finished all the boilerplate functions and methods, still missing tre…
…e traversal algorithm.
Added chain traversing code, pretty simple stuff.
Minor type modification.
Forgot a ;...
Coros update the recent in chain now with every resume.
Moved updating mechanism to a place where it gets called.
Added the recentInChain update call to Coroutine run.
thanks for the request but github says it can't automerge - could you fix this and make another request? Thanks
I guess not.
I'd welcome anyone else's attempt at a automerge-able patch. I'd do it myself but I have limited time these day.