Mercurial > projects > ldc
comparison tango/example/cluster/qrequest.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 private import tango.util.log.Configurator; | |
2 | |
3 private import tango.net.cluster.NetworkQueue; | |
4 | |
5 private import tango.net.cluster.tina.Cluster; | |
6 | |
7 /******************************************************************************* | |
8 | |
9 Illustrates how to setup and use a Queue in synchronous mode | |
10 | |
11 *******************************************************************************/ | |
12 | |
13 void main () | |
14 { | |
15 // join the cluster | |
16 auto cluster = (new Cluster).join; | |
17 | |
18 // access a queue of the specified name | |
19 auto queue = new NetworkQueue (cluster, "my.queue.channel"); | |
20 | |
21 // stuff something into the queue | |
22 queue.log.info ("sending three messages to the queue"); | |
23 queue.put (queue.EmptyMessage); | |
24 queue.put (queue.EmptyMessage); | |
25 queue.put (queue.EmptyMessage); | |
26 | |
27 // retreive synchronously | |
28 while (queue.get) | |
29 queue.log.info ("retrieved msg"); | |
30 } |