OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
ui.ui_dispatcher_if.UiDispatcherIf Class Reference

Schedule callbacks without exposing a concrete frontend event loop. More...

Inheritance diagram for ui.ui_dispatcher_if.UiDispatcherIf:
apps.carUi.car_ui_frontend_if.CarUiFrontendIf

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.

Detailed Description

Schedule callbacks without exposing a concrete frontend event loop.

Member Function Documentation

◆ cancel_ui_callback()

None ui.ui_dispatcher_if.UiDispatcherIf.cancel_ui_callback ( self,
object callback_id )

Cancel pending work from the frontend thread; inert tokens are harmless.

Parameters
callback_idToken returned by schedule_ui_callback().

◆ dispatch_ui()

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.

Parameters
callbackWork to invoke on the frontend thread.

◆ schedule_ui_callback()

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.

Parameters
delay_msNon-negative scheduling delay in milliseconds.
callbackWork to invoke after the delay.
Returns
Opaque token identifying the pending callback.

The documentation for this class was generated from the following file:
  • ui/ui_dispatcher_if.py