MCPcopy Index your code
hub / github.com/github/copilot-sdk / wait_for_event

Function wait_for_event

python/e2e/test_multi_client_e2e.py:190–206  ·  view source on GitHub ↗
(session, predicate, timeout: float = 30.0)

Source from the content-addressed store, hash-verified

188
189
190def wait_for_event(session, predicate, timeout: float = 30.0):
191 loop = asyncio.get_running_loop()
192 future = loop.create_future()
193
194 def on_event(event):
195 if not future.done() and predicate(event):
196 future.set_result(event)
197
198 unsubscribe = session.on(on_event)
199
200 async def wait():
201 try:
202 return await asyncio.wait_for(future, timeout=timeout)
203 finally:
204 unsubscribe()
205
206 return loop.create_task(wait())
207
208
209class TestMultiClientBroadcast:

Calls 2

waitFunction · 0.85
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…