Class ZMQ::Poller
In: lib/ffi-rzmq/poll.rb
Parent: Object

Methods

Attributes

readables  [R] 
writables  [R] 

Public Class methods

Public Instance methods

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.

A helper method to deregister a pollable for readable events.

A helper method to deregister a pollable for writable events.

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.

Register the pollable for events. This method is idempotent meaning it can be called multiple times with the same data and the socket will only get registered at most once. Calling multiple times with different values for events will OR the event information together.

A helper method to register a pollable as readable events only.

A helper method to register a pollable for writable events only.

[Validate]