Schedule callbacks without exposing a concrete frontend event loop. More...
Public Member Functions | |
| None | dispatch_ui (self, Callable[[], None] callback) |
| Enqueue work from any thread without calling frontend toolkit functions. | |
| object | schedule_ui_callback (self, int delay_ms, Callable[[], None] callback) |
| Schedule a timer on the frontend thread and return a cancellation token. | |
| None | cancel_ui_callback (self, object callback_id) |
| Cancel pending work from the frontend thread; inert tokens are harmless. | |
Schedule callbacks without exposing a concrete frontend event loop.
| None ui.ui_dispatcher_if.UiDispatcherIf.cancel_ui_callback | ( | self, | |
| object | callback_id ) |
Cancel pending work from the frontend thread; inert tokens are harmless.
| callback_id | Token returned by schedule_ui_callback(). |
| None ui.ui_dispatcher_if.UiDispatcherIf.dispatch_ui | ( | self, | |
| Callable[[], None] | callback ) |
Enqueue work from any thread without calling frontend toolkit functions.
Closed dispatchers discard submissions; callbacks already running finish.
| callback | Work to invoke on the frontend thread. |
| object ui.ui_dispatcher_if.UiDispatcherIf.schedule_ui_callback | ( | self, | |
| int | delay_ms, | ||
| Callable[[], None] | callback ) |
Schedule a timer on the frontend thread and return a cancellation token.
Call this from the frontend thread only. Worker completions use dispatch_ui(). Closed dispatchers return an inert token.
| delay_ms | Non-negative scheduling delay in milliseconds. |
| callback | Work to invoke after the delay. |