Detecting when child shred has finished
Is it possible to determine when a child shred has finished executing if you have a reference to the child shred? For example, in this code: // define function go() fun void go() { // insert code } // spork another, store reference to new shred in offspring spork ~ go() => Shred @ offspring; Is it possible to determine when offspring is done executing?
Paul Reiners wrote:
Is it possible to determine when a child shred has finished executing if you have a reference to the child shred? For example, in this code:
// define function go() fun void go() { // insert code }
// spork another, store reference to new shred in offspring spork ~ go() => Shred @ offspring;
Is it possible to determine when offspring is done executing?
I have only done boiler-plate stuff with events so far ... maybe you can fire an event at the end of your go() method and listen for that event outside of the sporked shred? michael
Paul Reiners; Is it possible to determine when a child shred has finished executing
if you have a reference to the child shred?
I'd say so, let me quote from the "VERSIONS" file from the latest release;
- (added) int Shred.done() // is the shred done?
int Shred.running() // is the shred running?
I'm not 100% sure what "running" is supposed to refer to (perhaps I
misunderstand it?) but "done" seems to suit your needs;
================== 8<================
fun void foo()
{
second => now;
}
spork ~ foo() @=> Shred bar;
<<
participants (3)
-
Kassen
-
Michael Heuer
-
Paul Reiners