ZeroMQ has an option where the subscribe socket only keeps the last
message. I was wondering if there is a way to specify that.
Something like the following:
using ZMQ
ctx = Context()
s = Socket(ctx, SUB)
ZMQ.subscribe(s)
ZMQ.set_subscribe(ZMQ.CONFLATE, 1) # ERROR: LoadError: UndefVarError:
CONFLATE not defined
ZMQ.connect(s, "tcp://127.0.0.1:5001")
while true
msg = bytestring(ZMQ.recv(s))
println(msg)
end
The C++ analog would go something like this:
zmq::context_t context (1);
zmq::socket_t subscriber (context, ZMQ_SUB);
int conflate = 1;
*subscriber**.setsockopt(ZMQ_CONFLATE, &conflate, sizeof(conflate) );
// need this in julia*
subscriber.connect("tcp://localhost:5556");
subscriber.setsockopt(ZMQ_SUBSCRIBE, "", 0);
More generally, how are socket options specified in Julia?
http://api.zeromq.org/4-0:zmq-setsockopt
Thanks.