Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def removeAll(self):
"""
Remove all selectables, and return a list of them.
"""
if self.waker is not None:
self.removeReader(self.waker)
result = self._selectables.values()
for fd in self._reads:
self._updateRegistration(fd, KQ_FILTER_READ, KQ_EV_DELETE)
for fd in self._writes:
self._updateRegistration(fd, KQ_FILTER_WRITE, KQ_EV_DELETE)
self._reads.clear()
self._writes.clear()
self._selectables.clear()
if self.waker is not None:
self.addReader(self.waker)
return result
def removeAll(self):
"""
Remove all selectables, and return a list of them.
"""
if self.waker is not None:
self.removeReader(self.waker)
result = self._selectables.values()
for fd in self._reads:
self._updateRegistration(fd, KQ_FILTER_READ, KQ_EV_DELETE)
for fd in self._writes:
self._updateRegistration(fd, KQ_FILTER_WRITE, KQ_EV_DELETE)
self._reads.clear()
self._writes.clear()
self._selectables.clear()
if self.waker is not None:
self.addReader(self.waker)
return result