[zeromq-dev] Fwd: Exact matching on subscription topics

Staffan Gimåker staffan at spotify.com
Wed Jan 18 18:16:45 CET 2012


On Wed, 2012-01-18 at 10:57 -0600, Chuck Remes wrote:
> On Jan 18, 2012, at 10:41 AM, Staffan Gimåker wrote:
> 
> > Do you have any opinions on how the public API for this should look? I've started implementing this stuff so it'd be nice to know sooner rather than later :D
> > 
> > I'm thinking along the lines of just adding more socketops for this, e.g.:
> > 
> >   zmq_setsockopt(sock, ZMQ_SUBSCRIBE_EXACT, topic, topic_len);
> > 
> > Any other suggestions?
> 
> I think that is a good start. Once the code is working and available for other people to bang on, we'll get more input. Let me think out loud for a little here to see what everyone likes...
> 
> Alternative #1

That's pretty much exactly what I had in mind. Mostly because it's less
intrusive than alternative #2.

> Alternative #2
> 
> We deprecate the use of zmq_setsockopt() for setting subscription filters and create a dedicated mechanism for accomplishing this task.
> 
> e.g.
> zmq_setsockfilter(void * socket, int operation, void * operation_value, size_t operation_len);

Did you mean something akin to:

  zmq_setsockfilter(s, ZMQ_SUBSCRIBE, ZMQ_MATCH_PREFIX, topic,
topic_len);

?

That way we'd need only one single define per matching method, which I
think would be nice. OTOH, it sort of pollutes the public API.

/S




More information about the zeromq-dev mailing list