Events#
- RATapi.events.clear(key=None, callback=None)#
Clears all event callbacks or specific callback.
- Parameters:
callback (Callable[[Union[str, PlotEventData, ProgressEventData]], None]) – The callback for when the event is triggered.
- Return type:
None
- RATapi.events.get_event_callback(event_type)#
Returns all callbacks registered for the given event type.
- Parameters:
event_type (EventTypes) – The event type.
- Returns:
callback – The callback for the event type.
- Return type:
Callable[[Union[str, PlotEventData, ProgressEventData]], None]
- RATapi.events.notify(event_type, data)#
Calls registered callbacks with the data when event type has been triggered.
- Parameters:
event_type (EventTypes) – The event type that was triggered.
data (str or PlotEventData or ProgressEventData) – The data sent by the event. The message event data is a string.
- Return type:
None
- RATapi.events.register(event_type, callback)#
Registers a new callback for the event type.
- Parameters:
event_type (EventTypes) – The event type to register.
callback (Callable[[Union[str, PlotEventData, ProgressEventData]], None]) – The callback for when the event is triggered.
- Return type:
None