1
from eventlet.green import zmq
6
def bob_client(ctx, count):
8
bob = zmq.Socket(CTX, zmq.REQ)
9
bob.connect("ipc:///tmp/test")
11
for i in range(0, count):
14
print "BOB GOT:", bob.recv()
16
def alice_server(ctx, count):
17
print "STARTING ALICE"
18
alice = zmq.Socket(CTX, zmq.REP)
19
alice.bind("ipc:///tmp/test")
22
for i in range(0, count):
23
print "ALICE GOT:", alice.recv()
27
alice = eventlet.spawn(alice_server, CTX, 10)
28
bob = eventlet.spawn(bob_client, CTX, 10)