132
|
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
|