[dmd-concurrency] std.concurrency

Sean Kelly sean at invisibleduck.org
Tue Mar 9 06:38:50 PST 2010


On Mar 9, 2010, at 1:49 AM, Igor Lesik wrote:

>> Okay, I checked in the first cut of this module.  It still lacks receiveTimeout and receiveOnly, but plain old send/receive are in place.  I'll see about >improving it over then next N days.
> 
> Excellent, thanks.
> 
> Please, consider an idea to check if first parameter of receive() is not delegate but integral and treat it as timeout value. It makes both receiveTImeout() and receiveOnly() one liners.

Will do.

By the way, I've been thinking about receive((int x) {}, (Variant x) {}) and I wonder if rather than testing the first element in the queue and having the Variant delegate getting the value if it's not an int, that the correct behavior should perhaps be to search the entire queue for an int and if there aren't any then take the first element and give it to the Variant.  I suppose it would be easy enough for the user to imitate with two consecutive receives, the first having a 0 timeout though.


More information about the dmd-concurrency mailing list