Invoking an Invoked Coroutine

If I bound a coroutine to a member of the class in the constructor like this:

@bound_co: branch [_some_co]

I later abort it.

@bound_co.abort

Then I want to reinvoke it…

@bound.invoke???

Should I just be invoking the coroutine through the class instance or is there a way to invoke it through the member of the class like this? Thanks!

Invoked coroutines can not currently be re-invoked. You’d need to branch it again and rebind @bound_co to the new invoked coroutine returned from branch.

Ok, that is what I thought, thanks! So far, the new IDE is GREAT!

I am getting some errors with it however, I will report those soon.

As @GreatGuru says, once a coroutine has been aborted it is stale and cannot be resumed.

However, you can increment its pending count (the number of things that it is waiting on) by calling pending_increment() which will suspend the coroutine rather than aborting it. You can then resume it (if it isn’t waiting for other tasks to complete) by calling pending_decrement().

1 Like