On Tuesday, 27 October 2020 at 08:33:36 UTC, Johann Lermer wrote:
or you could use the fact, that receiveTimeout throws an exception, when main ends (although I don't know if this is the intended behaviour; the manual just says that it throws an exception when the sending thread was terminated):

If you're receiving you can listen for an OwnerTerminated message.

bool shouldExit = receiveTimeout((-1).seconds,
    (OwnerTerminated o) {}
);

https://run.dlang.io/is/2t50yS

Reply via email to