[zeromq-dev] Blocking on multiple outputs

Martin Sustrik sustrik at 250bpm.com
Thu Jun 2 08:36:23 CEST 2011


On 06/02/2011 08:25 AM, Martin Sustrik wrote:
> On 06/02/2011 08:17 AM, Pieter Hintjens wrote:
>
>> Perhaps this is a new pattern, yes. Possibly in the way we once had a
>> stream pattern in AMQP.
>
> Presumably. None of the current patterns seems to fit the problem.

Hm. Not really true. With subscription forwarding in place, the PUB/SUB 
pattern could be used to achieve something like this.

Video receiver would subscribe for particular video. The subscription 
would contain an unique identifier of the subscriber in addition to the 
name of the video to distinguish it from other users watching the same 
video at the same time.

The publisher would plug into the subscription mechanism using XPUB 
socket. When subscription is received it would start streaming the video 
broken into small frames. Each frame would be tagged by the subscription 
string to ensure that it gets to the right user.

Publisher-side filtering would guarantee that the stream is forwarded 
via particular patch without dissipating into different paths.

Moreover, accomplishing the goal with PUB/SUB would allow for all kinds 
of funny topologies. Say streaming video into a single device at a 
physical location and then distributing it to all the local boxes via 
multicast. Etc.

As for HWM, dropping messages seems reasonable in this model. If there's 
not enough memory to serve the video feed, the video would hickup 
occassionally.

Martin




More information about the zeromq-dev mailing list