On Wednesday, 29 January 2014 at 21:50:28 UTC, Casper Færgemand
wrote:
A small example:
while (true) {
receive(
(Tid tid, AddTid _) {some code}
(Tid tid, RemoveTid _) {some other code}
(string s) {broadcast stuff}
)
}
struct AddTid {}
struct RemoveTid {}
From where I sit that'
A small example:
while (true) {
receive(
(Tid tid, AddTid _) {some code}
(Tid tid, RemoveTid _) {some other code}
(string s) {broadcast stuff}
)
}
struct AddTid {}
struct RemoveTid {}
Hey, I'm handling concurrency with message passing, previously
with D's concurrency, now with Vibe-d, which I assume works the
same way.
My app is a chat server, and when a connection is opened to a
client, I store the Tid of the thread (or fibre?) handling
sending messages out to the client.