INNER CODE UNIT · Python
_call_event_handlers_sync
rio-labs/rio · rio/app.py:398
def _call_event_handlers_sync(
self,
handlers: t.Iterable[t.Callable[[T], t.Any]],
event_data: T,
) -> None:
"""
Same as `_call_event_handlers`, but without support for asynchronous
handlers.
"""
for handler in handlers:
# If the handler is available, call it and await it if necessary
try:
handler(event_data)
# Display and discard exceptions
except Exception:
print("Exception in event handler:")