MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / process_events_queue

Function process_events_queue

pymongo/asynchronous/topology.py:87–101  ·  view source on GitHub ↗
(queue_ref: weakref.ReferenceType[queue.Queue])

Source from the content-addressed store, hash-verified

85
86
87def process_events_queue(queue_ref: weakref.ReferenceType[queue.Queue]) -> bool: # type: ignore[type-arg]
88 q = queue_ref()
89 if not q:
90 return False # Cancel PeriodicExecutor.
91
92 while True:
93 try:
94 event = q.get_nowait()
95 except queue.Empty:
96 break
97 else:
98 fn, args = event
99 fn(*args)
100
101 return True # Continue PeriodicExecutor.
102
103
104class Topology:

Callers 2

targetMethod · 0.70
closeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected