Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: IOTaskExecutorService

[18:7] extends: EngineService

Wraps FXGL's IOTaskExecutorService, the engine service that executes IOTask objects. Reached at runtime through FXGL.getTaskService. Aussom users pass an IOTask wrapper (built via IOTask.of / IOTask.ofVoid, or returned from an fxgl-io method) and choose one of four execution strategies: synchronous, background thread, background thread with FX-thread callback dispatch, or background with a progress dialog.

Methods

  • IOTaskExecutorService (Ajo = null)

    Wraps an existing IOTaskExecutorService AussomJavaObject. Normally obtained from fxgl.getTaskService rather than constructed directly.

    • @p Ajo is an AussomJavaObject around an IOTaskExecutorService.
  • run (object Task)

    Runs the given IOTask synchronously on the calling thread. Returns the task result.

    • @p Task is an IOTask wrapper.
    • @r The task result.
  • runAsync (object Task)

    Runs the given IOTask on a background thread. Callbacks (onSuccess, onFailure) fire on that background thread.

    • @p Task is an IOTask wrapper.
    • @r this object
  • runAsyncFX (object Task)

    Runs the given IOTask on a background thread and marshals every callback (onSuccess, onFailure) back to the JavaFX UI thread. The recommended path for tasks that touch the scene graph in their success handler.

    • @p Task is an IOTask wrapper.
    • @r this object
  • runAsyncFXWithDialog (object Task, string Message)

    Like runAsyncFX but also displays a progress dialog while the task runs.

    • @p Task is an IOTask wrapper.
    • @p Message is a string shown in the dialog.
    • @r this object