MCPcopy
hub / github.com/zeromq/pyzmq / poll

Method poll

zmq/sugar/poll.py:80–106  ·  view source on GitHub ↗

Poll the registered 0MQ or native fds for I/O. If there are currently events ready to be processed, this function will return immediately. Otherwise, this function will return as soon the first event is available or after timeout milliseconds have elapsed. Parameter

(self, timeout: int | None = None)

Source from the content-addressed store, hash-verified

78 self._map[socket] -= 1
79
80 def poll(self, timeout: int | None = None) -> list[tuple[Any, int]]:
81 """Poll the registered 0MQ or native fds for I/O.
82
83 If there are currently events ready to be processed, this function will return immediately.
84 Otherwise, this function will return as soon the first event is available or after timeout
85 milliseconds have elapsed.
86
87 Parameters
88 ----------
89 timeout : int
90 The timeout in milliseconds. If None, no `timeout` (infinite). This
91 is in milliseconds to be compatible with ``select.poll()``.
92
93 Returns
94 -------
95 events : list
96 The list of events that are ready to be processed.
97 This is a list of tuples of the form ``(socket, event_mask)``, where the 0MQ Socket
98 or integer fd is the first element, and the poll event mask (POLLIN, POLLOUT) is the second.
99 It is common to call ``events = dict(poller.poll())``,
100 which turns the list of tuples into a mapping of ``socket : event_mask``.
101 """
102 if timeout is None or timeout < 0:
103 timeout = -1
104 elif isinstance(timeout, float):
105 timeout = int(timeout)
106 return zmq_poll(self.sockets, timeout=timeout)
107
108
109def select(

Callers 15

_monitored_queueFunction · 0.95
deviceFunction · 0.95
latency_echoFunction · 0.95
latencyFunction · 0.95
thr_sinkFunction · 0.95
throughputFunction · 0.95
testMethod · 0.95
test_retry_pollMethod · 0.95
test_pairMethod · 0.95
test_reqrepMethod · 0.95
test_pubsubMethod · 0.95
test_rawMethod · 0.95

Calls 1

zmq_pollFunction · 0.90

Tested by 15

testMethod · 0.76
test_retry_pollMethod · 0.76
test_pairMethod · 0.76
test_reqrepMethod · 0.76
test_pubsubMethod · 0.76
test_rawMethod · 0.76
test_timeoutMethod · 0.76
test_wakeupMethod · 0.76
test_subscribe_methodMethod · 0.76
test_poll_base_socketFunction · 0.76
test_poll_rawFunction · 0.76
test_socket_pollMethod · 0.36