Re: std.concurrency: The fate of unmatched messages

2015-07-11 Thread E.S. Quinn via Digitalmars-d-learn
On Saturday, 11 July 2015 at 02:15:02 UTC, ketmar wrote: so simply don't receive the messages you don't need right now. as i said, `receive()` doesn't look to top message only, it scans the whole mailbox, trying to find a message that matches. you can use `receiveTimeout()` to do nothing if t

Re: std.concurrency: The fate of unmatched messages

2015-07-10 Thread ketmar via Digitalmars-d-learn
On Fri, 10 Jul 2015 19:39:24 +, E.S. Quinn wrote: > the documentation i can find for std.concurrency mentions what happens > when one receive() call gets a message it doesn't understand. that `receive()` will not get such a message. `receive()` scans the whole mailbox to find the message it

Re: std.concurrency: The fate of unmatched messages

2015-07-10 Thread ketmar via Digitalmars-d-learn
On Sat, 11 Jul 2015 01:52:23 +, E.S. Quinn wrote: > On Friday, 10 July 2015 at 23:39:30 UTC, ketmar wrote: >> this way your `receive` will get all messages. simply do nothing in >> `Variant` handler to drop messages you don't want to process. >> >> >> [1] http://dlang.org/phobos/std_concurrenc

Re: std.concurrency: The fate of unmatched messages

2015-07-10 Thread E.S. Quinn via Digitalmars-d-learn
On Friday, 10 July 2015 at 23:39:30 UTC, ketmar wrote: this way your `receive` will get all messages. simply do nothing in `Variant` handler to drop messages you don't want to process. [1] http://dlang.org/phobos/std_concurrency.html#.receive The thing is, I want to do receive() in two sepa

std.concurrency: The fate of unmatched messages

2015-07-10 Thread E.S. Quinn via Digitalmars-d-learn
I'm putting together a program that uses std.concurrency to handle two child threads from the main thread; The kicker here is that both the children do very different things. And I would like to handle receive() calls for them in separate locations. But from what I can tell, each thread has o