summaryrefslogtreecommitdiff
path: root/examples/bench/pyzmq_client.py
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2014-08-11 16:33:29 -0400
committerMicah Anderson <micah@riseup.net>2014-08-11 16:33:29 -0400
commitcce638a8adf4e045ca5505afea4bda57753c31dd (patch)
treeb5e139d3359ac5b8c7b1afa8acbb1b5b6051c626 /examples/bench/pyzmq_client.py
initial import of debian package
Diffstat (limited to 'examples/bench/pyzmq_client.py')
-rw-r--r--examples/bench/pyzmq_client.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/bench/pyzmq_client.py b/examples/bench/pyzmq_client.py
new file mode 100644
index 0000000..9afccec
--- /dev/null
+++ b/examples/bench/pyzmq_client.py
@@ -0,0 +1,16 @@
+import zmq
+
+c = zmq.Context()
+s = c.socket(zmq.REQ)
+s.connect('tcp://127.0.0.1:10001')
+
+def echo(msg):
+ s.send(msg, copy=False)
+ msg2 = s.recv(copy=False)
+ return msg2
+
+class Client(object):
+ pass
+
+client = Client()
+client.echo = echo