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

Method _dispatch_lifecycle_event

python/copilot/client.py:3231–3250  ·  view source on GitHub ↗

Dispatch a lifecycle event to all registered handlers.

(self, event: SessionLifecycleEvent)

Source from the content-addressed store, hash-verified

3229 )
3230
3231 def _dispatch_lifecycle_event(self, event: SessionLifecycleEvent) -> None:
3232 """Dispatch a lifecycle event to all registered handlers."""
3233 with self._lifecycle_handlers_lock:
3234 # Copy handlers to avoid holding lock during callbacks
3235 typed_handlers = list(self._typed_lifecycle_handlers.get(event.type, []))
3236 wildcard_handlers = list(self._lifecycle_handlers)
3237
3238 # Dispatch to typed handlers
3239 for handler in typed_handlers:
3240 try:
3241 handler(event)
3242 except Exception:
3243 pass # Ignore handler errors
3244
3245 # Dispatch to wildcard handlers
3246 for handler in wildcard_handlers:
3247 try:
3248 handler(event)
3249 except Exception:
3250 pass # Ignore handler errors
3251
3252 async def _verify_protocol_version(self) -> None:
3253 """Send the ``connect`` handshake (with the optional token) and verify

Callers 1

handle_notificationMethod · 0.95

Calls 2

handlerFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected