MCPcopy Index your code
hub / github.com/python/cpython / poll2

Function poll2

Lib/test/support/asyncore.py:170–194  ·  view source on GitHub ↗
(timeout=0.0, map=None)

Source from the content-addressed store, hash-verified

168 _exception(obj)
169
170def poll2(timeout=0.0, map=None):
171 # Use the poll() support added to the select module in Python 2.0
172 if map is None:
173 map = socket_map
174 if timeout is not None:
175 # timeout is in milliseconds
176 timeout = int(timeout*1000)
177 pollster = select.poll()
178 if map:
179 for fd, obj in list(map.items()):
180 flags = 0
181 if obj.readable():
182 flags |= select.POLLIN | select.POLLPRI
183 # accepting sockets should not be writable
184 if obj.writable() and not obj.accepting:
185 flags |= select.POLLOUT
186 if flags:
187 pollster.register(fd, flags)
188
189 r = pollster.poll(timeout)
190 for fd, flags in r:
191 obj = map.get(fd)
192 if obj is None:
193 continue
194 readwrite(obj, flags)
195
196poll3 = poll2 # Alias for backward compatibility
197

Callers

nothing calls this directly

Calls 8

listClass · 0.85
readwriteFunction · 0.85
pollMethod · 0.45
itemsMethod · 0.45
readableMethod · 0.45
writableMethod · 0.45
registerMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…