Mercurial > projects > ldc
comparison tango/example/cluster/cclient.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.NetworkCache; | |
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 if (args.length > 1) | |
26 { | |
27 auto cluster = (new Cluster).join (args[1..$]); | |
28 auto cache = new NetworkCache (cluster, "my.cache.channel"); | |
29 | |
30 while (true) | |
31 { | |
32 w.start; | |
33 for (int i=10000; i--;) | |
34 cache.put ("key", cache.EmptyMessage); | |
35 | |
36 Stdout.formatln ("{} put/s", 10000/w.stop); | |
37 | |
38 w.start; | |
39 for (int i=10000; i--;) | |
40 cache.get ("key"); | |
41 | |
42 Stdout.formatln ("{} get/s", 10000/w.stop); | |
43 } | |
44 } | |
45 else | |
46 Stdout.formatln ("usage: cache cachehost:port ..."); | |
47 } | |
48 |