Skip to content

AppTaskExecutor

Runs an AppTask by putting it on the AppTaskController queue.

Each time it is resumed (e.g. by a PeriodicTrigger), the executor is wrapped in a new UserTask and enqueued. The app then starts, cancels or finishes the task with UserTask.onStart, UserTask.onCancel and UserTask.onDone. The executor pauses itself again after 5 seconds, so it can be resumed by the next trigger.

Special-purpose UserTasks are created by a UserTaskFactory registered with AppTaskController.registerUserTaskFactory.

Inheritance

Constructors

AppTaskExecutor

AppTaskExecutor<TConfig extends AppTask>()

Properties

probes

List<Probe> get probes
override

The probes in this task executor. Empty for tasks without measures.

Methods

onInitialize

bool onInitialize()
override

Called by initialize. Returns true if successfully initialized.

If false, the executor stays in ExecutorState.Created. This is a synchronous method and must be light-weight.

onPause

Future<bool> onPause()
override

Called by pause. Returns true if successfully paused.

If false, the state is not changed.

onResume

Future<bool> onResume()
override

Called by resume. Returns true if successfully resumed.

If false, the executor moves to ExecutorState.PausedButShouldBeResumed.