[zeromq-dev] Pub/Sub anchoring/keyframing and administrative layers in general
Martin Sustrik
sustrik at 250bpm.com
Sun Jul 25 09:53:53 CEST 2010
Hi Oliver,
> While refactoring a data-streaming subsystem today, I realized that
> using ZeroMQ with pub/sub would save me having to repeat the
> distribution process across a whole chain of processes.
>
> With the exception that, at some point, the listeners need to obtain the
> base state.
I suspect what you need is last-value cache. I.e. if you subscribe for
topic X you first get the latest known value of X, then catch up with
the stream of updates as usual. Right?
> In video-streaming terms, I guess you would call this keyframing or keying.
>
> Example:
>
> socket_t outSocket(ctx, ZMQ_SUB) ;
> zmq_connect(outSocket, publisher) ;
> zmq_setsockopt(outSocket, ZMQ_KEYFRAMING, _keyFrameReceiverCallback) ;
> zmq_setsockopt(outSocket, ZMQ_SUBSCRIBE. subscription) ;
>
> The keyframing option automatically sends an out-of-band message to the
> publisher which tells it to send a response with the last keyframe,
> which is then processed by the receiver callback.
If my scenario above is not exactly what you need, please do describe
what you are trying to achieve. Solution to unknown problem is pretty
hard to discuss.
> Aware of Martin's comments regarding separate administrative layers, I'm
> just wondering if anyone has already created something like this?
>
> Or if not, what the ZeroMQ devs would recommend as a reusable approach
> for implementing this in a 0MQ-contributable fashion?
>
> A device?
Depends on the problem.
> If so, I'm already thinking - given Brian Grainger's questions - that it
> might be worth looking at a coherent infrastructure for user-extended
> devices. Such that any well-implemented re-usable layers could be
> contributed into the ZeroMQ source and then combined as needed into
> custom devices by end users.
Definitely. But as noted above, describing and formalising the problem
is the very first step to take.
Martin
More information about the zeromq-dev
mailing list