MCPcopy
hub / github.com/gorakhargosh/watchdog / remove

Method remove

src/watchdog/utils/delayed_queue.py:68–77  ·  view source on GitHub ↗

Remove and return the first items for which predicate is True, ignoring delay.

(self, predicate: Callable[[T], bool])

Source from the content-addressed store, hash-verified

66 return head
67
68 def remove(self, predicate: Callable[[T], bool]) -> T | None:
69 """Remove and return the first items for which predicate is True,
70 ignoring delay.
71 """
72 with self._lock:
73 for i, (elem, *_) in enumerate(self._queue):
74 if predicate(elem):
75 del self._queue[i]
76 return elem
77 return None

Callers 7

__init__Method · 0.45
on_any_eventMethod · 0.45
rmFunction · 0.45
mvFunction · 0.45
inotify_rm_watchFunction · 0.45
test_watch_fileFunction · 0.45
test_select_fdFunction · 0.45

Calls

no outgoing calls

Tested by 4

on_any_eventMethod · 0.36
inotify_rm_watchFunction · 0.36
test_watch_fileFunction · 0.36
test_select_fdFunction · 0.36