On Sat, 11 Jul 2015 01:52:23 +0000, 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_concurrency.html#.receive > > The thing is, I want to do receive() in two separate places, and I want > each receive() call to leave the other's messages alone, not drop them.
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 there are no suitable messages. you can also adjust mailbox size and mode.
signature.asc
Description: PGP signature