BackgroundTaskExecutor
Runs a BackgroundTask by creating and running one Probe per measure.
Probes are created with SamplingPackageRegistry.create; measures with no probe on this phone are skipped with a warning. On resume, the devices of the probes are connected. If the task has a duration, the executor pauses itself after that duration. It also pauses when all its probes have paused.
- Inheritance
-
- Object
- AbstractExecutor<
BackgroundTask> - AggregateExecutor<
BackgroundTask> - TaskExecutor<
BackgroundTask> - BackgroundTaskExecutor
Constructors
BackgroundTaskExecutor
Properties
haveAllProbesPaused
Are all probes in a paused state?
probes
The probes in this task executor. Empty for tasks without measures.
Methods
connectAllConnectableDevices
Starts connecting the devices of all probes.
Skips devices already connecting. Does not wait for the connections.
onInitialize
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
Called by pause. Returns true if successfully paused.
If false, the state is not changed.
onResume
Called by resume. Returns true if successfully resumed.
If false, the executor moves to ExecutorState.PausedButShouldBeResumed.