Feature recentInChain #126

Open
wants to merge 9 commits into
from

Conversation

Projects
None yet
3 participants
@ghost

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
    loop(
        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

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

    return nil
)

run

@ghost ghost closed this Apr 30, 2012

@ghost ghost reopened this Jun 10, 2012

@stevedekorte

This comment has been minimized.

Show comment
Hide comment
@stevedekorte

stevedekorte Apr 8, 2015

Member

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

Member

stevedekorte commented Apr 8, 2015

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

@0joshuaolson1

This comment has been minimized.

Show comment
Hide comment
@0joshuaolson1

0joshuaolson1 Feb 1, 2016

I guess not.

I guess not.

@stevedekorte

This comment has been minimized.

Show comment
Hide comment
@stevedekorte

stevedekorte Feb 3, 2016

Member

I'd welcome anyone else's attempt at a automerge-able patch. I'd do it myself but I have limited time these day.

Member

stevedekorte commented Feb 3, 2016

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