Skip to content

Feature recentInChain #126

wants to merge 9 commits into from

3 participants

ghost commented Jul 25, 2011

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(
    o @@l

        writeln("i: " .. i)
        if(i==2, o actorCoroutine recentInChain resumeLater; "\nobject should resume now\n" print) //here its resumed explicitly

    return nil

@ghost ghost closed this Apr 30, 2012
@ghost ghost reopened this Jun 10, 2012

thanks for the request but github says it can't automerge - could you fix this and make another request? Thanks

MrMormon commented Feb 1, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.