Mercurial > projects > ldc
comparison tango/example/cluster/qclient.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 /******************************************************************************* | |
2 | |
3 | |
4 *******************************************************************************/ | |
5 | |
6 import tango.io.Stdout; | |
7 | |
8 import tango.time.StopWatch; | |
9 | |
10 import tango.util.log.Configurator; | |
11 | |
12 import tango.net.cluster.NetworkQueue; | |
13 | |
14 import tango.net.cluster.tina.Cluster; | |
15 | |
16 /******************************************************************************* | |
17 | |
18 | |
19 *******************************************************************************/ | |
20 | |
21 void main (char[][] args) | |
22 { | |
23 StopWatch w; | |
24 | |
25 auto cluster = (new Cluster).join; | |
26 auto queue = new NetworkQueue (cluster, "my.queue.channel"); | |
27 | |
28 while (true) | |
29 { | |
30 w.start; | |
31 for (int i=10000; i--;) | |
32 queue.put (queue.EmptyMessage); | |
33 | |
34 Stdout.formatln ("{} put/s", 10000/w.stop); | |
35 | |
36 uint count; | |
37 w.start; | |
38 while (queue.get !is null) | |
39 ++count; | |
40 | |
41 Stdout.formatln ("{} get/s", count/w.stop); | |
42 } | |
43 } | |
44 |