On Friday, 23 March 2012 at 00:14:00 UTC, Sean Kelly wrote:
While sending messages like a bare string might be good for
example code, any real application is going to use structured
messages whose type is specific to what the message is for,
contains fields like sender Tid, etc. It seems like you're
aiming more for CSP where you'd create a separate communication
channel per use. You could even fake it by wrapping
send/receive with your own CSP-like API, though it's quite
likely that a from-scratch CSP style implementation would be
faster because there'd be no need to package messages.
I see your point. To make this easier, may I suggest:
T receiveNext(T)() {
T r;
receive((T t) {r = t;});
return r;
}
A big reason for the use of receiveOnly (in my code) is its
convenience. receiveNext, and a discouragement of using
receiveOnly, would be a simpler solution.
Used to work, and std.concurrency doesn't even use std.utf.
Not sure what's going on there.
Weird :(
NMS