base_handler
framewise_meet_client.events.base_handler
EventHandler
Bases: Generic[T]
Base class for event handlers.
Source code in framewise_meet_client/events/base_handler.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__init__(dispatcher)
Initialize the event handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dispatcher
|
Event dispatcher instance |
required |
Source code in framewise_meet_client/events/base_handler.py
17 18 19 20 21 22 23 |
|
register(handler_func)
Register a handler function for this event type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handler_func
|
Callable[[T], Any]
|
Function that takes a strongly-typed message object |
required |
Returns:
Type | Description |
---|---|
Callable[[Union[Dict[str, Any], T]], Any]
|
The original handler function for chaining |
Source code in framewise_meet_client/events/base_handler.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
register_event_handler(app, event_type, handler_func)
Register a handler function for the given event type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app
|
App instance |
required | |
event_type
|
str
|
Event type string |
required |
handler_func
|
Callable
|
Function to handle the event |
required |
Returns:
Type | Description |
---|---|
The original handler function for chaining |
Source code in framewise_meet_client/events/base_handler.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|