Executor
Runs one part of a deployment, configured by a TConfig.
Executors form a tree: a SmartphoneDeploymentExecutor runs a TaskControlExecutor per task control, which runs a TriggerExecutor and a TaskExecutor, which runs a Probe per measure.
The behavior of an executor is controlled by its lifecycle methods: initialize, resume, pause, and dispose. A paused executor can be resumed again. state holds the current ExecutorState and stateEvents is a broadcast stream of state changes. If an error occurs, the state becomes ExecutorState.Undefined.
Collected data comes out of the measurements stream. To listen to all measurements from all studies on this phone, use SmartPhoneClientManager.measurements.
- Implementers
Constructors
Executor
Properties
configuration
The configuration of this executor as set in initialize.
deployment
The deployment that this executor is part of executing.
measurements
The stream of Measurement collected by this executor.
samplingState
The runtime sampling state of this executor.
state
The runtime state of this executor.
stateEvents
The runtime state changes of this executor.
Methods
dispose
Disposes this executor.
If not already paused, pause will be called first.
Once disposed, the executor cannot be used anymore and nothing will happen if any of the life cycle methods are called.
initialize
- TConfig configuration, [
- SmartphoneDeployment? deployment
Configures and initializes the executor. Call before resume.
pause
Pauses the executor until resume is called.
pauseButShouldBeResumed
Pauses the executor and marks it to be resumed later.
The state becomes ExecutorState.PausedButShouldBeResumed, e.g. when its device is temporarily disconnected.
resume
Starts or resumes the executor.