| Class | ZMQ::Poller |
| In: |
lib/ffi-rzmq/poll.rb
|
| Parent: | Object |
| readables | [R] | |
| writables | [R] |
Deletes the pollable for all subscribed events. Called internally when a socket has been deregistered and has no more events registered anywhere.
Can also be called directly to remove the socket from the polling array.
Deregister the pollable for events. When there are no events left or socket has been closed this also deletes the socket from the poll items.
Checks each registered socket for selectability based on the poll items’ registered events. Will block for up to timeout milliseconds. A millisecond is 1/1000 of a second, so to block for 1 second pass the value "1000" to poll.
Pass "-1" or +:blocking+ for timeout for this call to block indefinitely.
This method will return immediately when there are no registered sockets. In that case, the timeout parameter is not honored. To prevent a CPU busy-loop, the caller of this method should detect this possible condition (via size) and throttle the call frequency.
Returns 0 when there are no registered sockets that are readable or writable.
Return 1 (or greater) to indicate the number of readable or writable sockets. These sockets should be processed using the readables and writables accessors.
Returns -1 when there is an error. Use ZMQ::Util.errno to get the related error number.
The non-blocking version of poll. See the poll description for potential exceptions.
May return -1 when an error is encounted. Check ZMQ::Util.errno to determine the underlying cause.