[zeromq-dev] ZMQ_POLLER

Pieter Hintjens ph at imatix.com
Wed Oct 21 11:44:28 CEST 2015


Nice stuff...

Can you s/close/destroy/?

Also we might drop the _socket on add, remove, modify as it's the
default majority case. FDs are unusual and can do extra work.

Lastly, as we start to add new classes to the ZMQ API, maybe we can
start to generate the man pages from the API header, as we do in CZMQ
etc. We probably want to keep a single zmq.h. So this means
identifying API sections within that file.

I'd rather see this in a single man page, rather than split over nine
pages as we have done so far.

-Pieter


On Wed, Oct 21, 2015 at 9:32 AM, Doron Somech <somdoron at gmail.com> wrote:
> Hi All,
>
> Few days ago I pushed ZMQ_POLLER to zeromq master. ZMQ_POLLER is a new API
> to poll on multiple sockets and hopefully in the future will deprecate
> ZMQ_POLL method.
> ZMQ_POLLER API is very similar to zpoller from CZMQ. There are two main
> reasons for ZMQ_POLLER:
>
> * ZMQ_POLL doesn't support client and server sockets. I want one simple API
> which will be able to support both thread-safe and not thread safe sockets.
> ZMQ_POLLER support both.
> * Using ZMQ_POLL is actually a little complicated to use and most binding
> implement something like zpoller to make the usage simpler, now binding can
> use ZMQ_POLLER directly.
>
> The API is of course not stable yet and will appreciate comments, anyway
> following is the ZMQ_POLLER API:
>
>
> ZMQ_EXPORT void *zmq_poller_new ();
> ZMQ_EXPORT int  zmq_poller_close (void *poller);
> ZMQ_EXPORT int  zmq_poller_add_socket (void *poller, void *socket, void
> *user_data, short events);
> ZMQ_EXPORT int  zmq_poller_modify_socket (void *poller, void *socket, short
> events);
> ZMQ_EXPORT int  zmq_poller_remove_socket (void *poller, void *socket);
> ZMQ_EXPORT int  zmq_poller_wait (void *poller, zmq_poller_event_t *event,
> long timeout);
>
> ZMQ_EXPORT int zmq_poller_add_fd (void *poller, SOCKET fd, void *user_data,
> short events);
> ZMQ_EXPORT int zmq_poller_modify_fd (void *poller, SOCKET fd, short events);
> ZMQ_EXPORT int zmq_poller_remove_fd (void *poller, SOCKET fd);
>
> Following are two relevant pull requests (one of them is not merged yet):
>
> https://github.com/zeromq/libzmq/pull/1616
> https://github.com/zeromq/libzmq/pull/1611
>
> Doron
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list