ext/czmq/doc/zloop.txt in rbczmq-1.7.1 vs ext/czmq/doc/zloop.txt in rbczmq-1.7.2
- old
+ new
@@ -30,10 +30,15 @@
// are specified, uses only socket. If multiple poll items exist for same
// socket/FD, cancels ALL of them.
CZMQ_EXPORT void
zloop_poller_end (zloop_t *self, zmq_pollitem_t *item);
+// Configure a registered pollitem to ignore errors. If you do not set this,
+// then pollitems that have errors are removed from the reactor silently.
+CZMQ_EXPORT void
+ zloop_set_tolerant (zloop_t *self, zmq_pollitem_t *item);
+
// Register a timer that expires after some delay and repeats some number of
// times. At each expiry, will call the handler, passing the arg. To
// run a timer forever, use 0 times. Returns 0 if OK, -1 if there was an
// error.
CZMQ_EXPORT int
@@ -89,11 +94,12 @@
// After 10 msecs, send a ping message to output
zloop_timer (loop, 10, 1, s_timer_event, output);
// When we get the ping message, end the reactor
zmq_pollitem_t poll_input = { input, 0, ZMQ_POLLIN };
- rc = zloop_poller (loop, &poll_input, s_socket_event, NULL);
+ rc = zloop_poller (loop, &poll_input, s_socket_event, NULL);
assert (rc == 0);
+ zloop_set_tolerant (loop, &poll_input);
zloop_start (loop);
zloop_destroy (&loop);
assert (loop == NULL);