Пример #1
0
def send_message():
    outsock = DieselZMQSocket(zctx.socket(zmq.DEALER), connect="tcp://127.0.0.1:5000")

    for x in xrange(500000):
        outsock.send("yo dawg %s" % x)
        if x % 1000 == 0:
            sleep()
Пример #2
0
def send_message():
    outsock = DieselZMQSocket(zctx.socket(zmq.DEALER),
                              connect="tcp://127.0.0.1:5000")

    for x in xrange(500000):
        outsock.send("yo dawg %s" % x)
        if x % 1000 == 0:
            sleep()
Пример #3
0
def send_message():
    global t
    outsock = DieselZMQSocket(zctx.socket(zmq.DEALER), connect="inproc://foo")
    t = time.time()

    for x in xrange(500000):
        outsock.send("yo dawg %s" % x)
        if x % 1000 == 0:
            sleep()
Пример #4
0
def echo_client():
    sock = zctx.socket(zmq.DEALER)
    sock.identity = "client:%d" % cids.pop()
    s = DieselZMQSocket(sock, connect='tcp://127.0.0.1:4321')
    for i in xrange(10):
        s.send('msg:%d' % i)
        r = s.recv()
        assert r == 'msg:%d' % i
        print sock.identity, 'received', r
Пример #5
0
def echo_client():
    sock = zctx.socket(zmq.DEALER)
    sock.identity = "client:%d" % cids.pop()
    s = DieselZMQSocket(sock, connect='tcp://127.0.0.1:4321')
    for i in xrange(10):
        s.send('msg:%d' % i)
        r = s.recv()
        assert r == 'msg:%d' % i
        print sock.identity, 'received', r