Re: Message passing pattern matching

2014-01-29 Thread Stanislav Blinov
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'

Re: Message passing pattern matching

2014-01-29 Thread Casper Færgemand
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 {}

Message passing pattern matching

2014-01-29 Thread Casper Færgemand
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.