ZMQPoll
class ZMQPoll (View source)
Class ZMQPoll
Methods
(PECL zmq >= 0.5.0) Count the items in the poll set.
(PECL zmq >= 0.5.0) Returns the ids of the objects that had errors in the last poll.
(PECL zmq >= 0.5.0) Polls the items in the current poll set.
Details
int
add(ZMQSocket $entry, int $type)
(PECL zmq >= 0.5.0) Adds a new item to the poll set and returns the internal id of the added item.
The item can be removed from the poll set using the returned string id. Returns a string id of the added item which can be later used to remove the item.
ZMQPoll
clear()
(PECL zmq >= 1.0.4) Clears all elements from the poll set.
int
count()
(PECL zmq >= 0.5.0) Count the items in the poll set.
int[]
getLastErrors()
(PECL zmq >= 0.5.0) Returns the ids of the objects that had errors in the last poll.
Returns an array containing ids for the items that had errors in the last poll. Empty array is returned if there were no errors.
int
poll(array $readable, array $writable, int $timeout = -1)
(PECL zmq >= 0.5.0) Polls the items in the current poll set.
The readable and writable items are returned in the readable and writable parameters. ZMQPoll::getLastErrors() can be used to check if there were errors. Returns an int representing amount of items with activity.
bool
remove(ZMQSocket|string|mixed $item)
(PECL zmq >= 0.5.0) Remove item from the poll set.
The item parameter can be ZMQSocket object, a stream resource or the id returned from ZMQPoll::add() method. Returns true if the item was removed and false if the object with given id does not exist in the poll set.