Exemple #1
0
def test_zsocket():
    ctx = zctx.new()
    push = zsocket.new(ctx, zmq.PUSH)
    pull = zsocket.new(ctx, zmq.PULL)
    zsocket.bind(push, 'inproc://test')
    zsocket.connect(pull, 'inproc://test')
    zstr.send(push, 'foo')
    assert zstr.recv(pull) == 'foo'
    zstr.send(push, 'foo')
    zsocket.poll(pull, 1)
    assert zstr.recv_nowait(pull) == 'foo'
Exemple #2
0
 def recv_nowait(self):
     return zstr.recv_nowait(self.sock)
Exemple #3
0
 def recv_nowait(self):
     return zstr.recv_nowait(self.sock)