Task dispatcher. More...
Classes | |
| interface | Task |
| A task that can be added for execution by Task Dispatcher. More... | |
Public Member Functions | |
| boolean | isEmpty () |
| Indicates whether the task dispatcher does not contain pending tasks. | |
| boolean | isQuitting () |
| Indicates whether the task dispatcher is quitting. | |
| void | submit (Task task) |
| Submits a task. | |
Task dispatcher.
Use TaskDispatcher to schedule execution of callbacks to the Kanzi UI thread. You can access a Kanzi UI object only on the same thread where you create object. You can wrap code that accesses UI objects with tasks and submit them to the TaskDispatcher from any thread. The UI thread executes these tasks during its main loop.
While the main loop runs no frames, the tasks that you submit wait until it runs again, and then Kanzi executes all of them in one frame. In Kanzi Android framework (droidfw), the main loop runs no frames while no Kanzi view is active. If you submit tasks at a high rate, coalesce them, so that a backlog of tasks does not delay the next frame.
| boolean isEmpty | ( | ) |
Indicates whether the task dispatcher does not contain pending tasks.
| boolean isQuitting | ( | ) |
Indicates whether the task dispatcher is quitting.
This flag is set before the emptying of the task queue begins.