I try to receive message using the PUB-SUB pattern of ZMQ.jl. However, the function, ZMQ.recv(), is waiting for the message from PUB side and blocked there. Is there any way to receive the message without blocking? The code is as follows.
using ZMQ skt_receive = Socket(ctx, SUB) ZMQ.subscribe( skt_receive ) ZMQ.connect( skt_receive , "tcp://localhost:5556" ) msg = ZMQ.recv( skt_receive ) # blocked when there is no message sent from PUB side @show msg while true try msg = ZMQ.recv( skt_receive ) # blocked here catch println("no message comes.") end end