Rescuer class
Keeps {@link Flusher} running.
class Rescuer implements RepeatingCommand {
SchedulerImpl _schedulerImpl;
Rescuer(this._schedulerImpl);
bool execute() {
if ( _schedulerImpl._flushRunning) {
/*
* Since JS is single-threaded, if we're here, then than means that
* FLUSHER.execute() started, but did not finish. Reschedule FLUSHER.
*/
_schedulerImpl.scheduleFixedDelay( _schedulerImpl.flusher, SchedulerImpl._FLUSHER_DELAY);
}
return _schedulerImpl._shouldBeRunning;
}
}
Implements
Constructors
new Rescuer(SchedulerImpl _schedulerImpl) #
Methods
bool execute() #
Returns true if the RepeatingCommand should be invoked again.
docs inherited from RepeatingCommand
bool execute() {
if ( _schedulerImpl._flushRunning) {
/*
* Since JS is single-threaded, if we're here, then than means that
* FLUSHER.execute() started, but did not finish. Reschedule FLUSHER.
*/
_schedulerImpl.scheduleFixedDelay( _schedulerImpl.flusher, SchedulerImpl._FLUSHER_DELAY);
}
return _schedulerImpl._shouldBeRunning;
}