RandomRecurrentTriggerExecutor class
Runs a RandomRecurrentTrigger: fires a random number of times per day.
The times are random, between startTime and endTime. A daily cron job at startTime sets up the timers for the day. If resumed after startTime, the timers for today are set up right away, unless hasBeenScheduledForToday is true.
- Inheritance
-
- Object
- AbstractExecutor<
RandomRecurrentTrigger> - TriggerExecutor<
RandomRecurrentTrigger> - SchedulableTriggerExecutor<
RandomRecurrentTrigger> - RandomRecurrentTriggerExecutor
Constructors
Properties
- configuration → RandomRecurrentTrigger?
-
The configuration of this executor as set in initialize.
no setterinherited
- deployment → SmartphoneDeployment?
-
The deployment that this executor is part of executing.
no setterinherited
- endTime → TimeOfDay
-
no setter
- hasBeenScheduledForToday → bool
-
Whether the timers for today have already been set up.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxNumberOfTriggers → int
-
no setter
-
measurements
→ Stream<
Measurement> -
The stream of
Measurementcollected by this executor.no setterinherited - minNumberOfTriggers → int
-
no setter
- numberOfSampling → int
-
A new random number of triggers for a day. Changes on every read.
no setter
- randomTime → TimeOfDay
-
A new random time between startTime and endTime. Changes on every read.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- samplingState → SamplingState
-
The runtime sampling state of this executor.
no setterinherited
-
samplingTimes
→ List<
TimeOfDay> -
A new list of random times between startTime and endTime.
Changes on every read.
no setter
- startTime → TimeOfDay
-
no setter
- state → ExecutorState
-
The runtime state of this executor.
no setterinherited
-
stateEvents
→ Stream<
ExecutorState> -
The runtime state changes of this executor.
no setterinherited
- timer ↔ Timer?
-
A timer for subclasses to use. Cancelled on pause and dispose.
getter/setter pairinherited
- todayString → String
-
Today's date as
year-month-day, without zero padding. Used in logs.no setter -
triggerEvents
→ Stream<
TriggerEvent> -
The stream of events triggered from this trigger executor.
no setterinherited
Methods
-
addError(
Object error, [StackTrace? stacktrace]) → void -
Logs
erroras a warning and adds it to the measurements stream.inherited -
addMeasurement(
Measurement measurement) → void -
Adds
measurementto the measurements stream.inherited -
dispose(
) → void -
Disposes this executor.
inherited
-
error(
) → void -
Moves this executor to ExecutorState.Undefined.
inherited
-
getSchedule(
DateTime from, DateTime to, [int max = 100]) → List< DateTime> -
Returns the times this trigger fires between
fromandto.override -
initialize(
RandomRecurrentTrigger configuration, [SmartphoneDeployment? deployment]) → void -
Configures and initializes the executor. Call before resume.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
) → Future< void> -
Callback when this executor is disposed.
inherited
-
onInitialize(
) → bool -
Called by initialize. Returns true if successfully initialized.
inherited
-
onPause(
) → Future< bool> -
Called by pause. Returns true if successfully paused.
inherited
-
onResume(
) → Future< bool> -
Called by resume. Returns true if successfully resumed.
override
-
onTrigger(
) → void -
Fires this trigger by adding a TriggerEvent to triggerEvents.
inherited
-
pause(
) → void -
Pauses the executor until resume is called.
inherited
-
pauseButShouldBeResumed(
) → void -
Pauses the executor and marks it to be resumed later.
inherited
-
resume(
) → void -
Starts or resumes the executor.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited