static void run()
{
while(true)
{
try
{
/// do work
...
// interacting with parent
auto msg = receiveTimeout(dur!"msecs"(1),
(string command)
{
/// process command from parent
if(some_condition_is_true)
break; // finish
// execution
}
);
}
catch(Throwable t)
{
/// some diagnostic message
}
}
}
...
auto child = spawn(&run);
...
?
