2
"""This launches an echoing rep socket device,
3
and runs a blocking numpy action. The rep socket should
4
remain responsive to pings during this time. Use heartbeater.py to
5
ping this heart, and see the responsiveness.
15
from zmq import devices
19
dev = devices.ThreadDevice(zmq.FORWARDER, zmq.SUB, zmq.XREQ)
20
dev.setsockopt_in(zmq.SUBSCRIBE, "")
21
dev.connect_in('tcp://127.0.0.1:5555')
22
dev.connect_out('tcp://127.0.0.1:5556')
28
A = numpy.random.random((2**11,2**11))
29
print "starting blocking loop"
32
numpy.dot(A,A.transpose())
33
print "blocked for %.3f s"%(time.time()-tic)