Again this code and to Pieter Hintjens, this code is supposed to be th
subscriber in the black box pattern in which the SUB socket will connect to
the PUB socket and then the PUSH socket will listen for PULL sockets from
the worker threads. so yes i DO know that one should use a SUB to connect
to a PUB. Please clarify your answer. This code is supposed to be able to
connect to a PUB socket and then bind a PUSH socket. BUT IT DOESNT WORK
context = zmq.Context()
app_worker = context.socket(zmq.PUSH)
app_worker.bind("tcp://127.0.0.1:9005")
app_sub = context.socket(zmq.SUB)
app_sub.connect("tcp://127.0.0.1:9004")
app_sub.setsockopt(zmq.SUBSCRIBE,'JULES')
while True:
msg = app_sub.recv()
msg_data = msg.split(' ',1)
app_worker.send_json(msg_data[1])
print msg_data[1]
but when i run this, it is unable to receive any message from the
publisher, but when i remove the lines,
app_worker = context.socket(zmq.PUSH)
app_worker.bind("tcp://127.0.0.1:9005")
it works normally, but i need it to be able to subscribe then process the
message and then push it to another
what am i doing
Isaiah Edward G. Turla
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev