ZMQ.jl, Receiving message Blocked, ZMQ.recv()

package
zmq

#1

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 

#2

I solved it by adding @async. I am not sure if it will consume a lot of memory because of creating Task object. Is there other better ways to do this?
The Python binding supporting input parameter of ZMQ.NOBLOCK and the function recv() raises an error when there is no message coming.

using ZMQ

skt_receive = Socket(ctx, SUB)
ZMQ.subscribe( skt_receive )
ZMQ.connect( skt_receive , "tcp://localhost:5556" )

while true
     @async begin     # memory consume ??
         msg = ZMQ.recv( skt_receive )    
     end
end 

#3

I would think @async should be very light weight.