Package limn.concurrent
package limn.concurrent
The threading model and the async API on top of it: a single UI thread that every widget
mutation is confined to, reached through
Ui, with
Ui.post(java.lang.Runnable) to cross onto it, Ui.async(java.util.function.Supplier<T>) for
future-shaped work, and Ui.work(limn.concurrent.Work.Body<T>) for a cancellable
Work that reports Progress and is held
as a Job. The backend installs the
UiRuntime at startup and drains its queue once per frame.
Confinement is checked, not advisory: a widget mutated off the UI thread throws, and every success, failure and progress callback this package delivers runs where touching widgets is legal.
-
ClassDescriptionA started piece of background work, as seen by whoever asked for it.The only handle a background body has on the outside world while it runs: it can ask whether it has been cancelled, and it can say how far it has got.Static facade over the toolkit's
UiRuntime, Limn's first-class async API.The concurrency runtime behindUi: a single UI thread fed by a thread-safe (MPSC) task queue, plus a worker pool for the application's heavy background work.Wakes the native event loop when work is posted from another thread.Work<T>A description of background work, built up and then started once.Work.Body<T>The background body.