Class: IntervalScheduler

IntervalScheduler()

new IntervalScheduler()

Author:
Source:

Members

_intervalIds :Object.<string, Interval>

Type:
Source:

_timeouts :Object.<string, number>

Type:
  • Object.<string, number>
Source:

intervals :Array.<Interval>

Type:
Source:

observable

Source:

Methods

_getIntervalId(interval) → {string}

Parameters:
Name Type Description
interval Interval
Source:
Returns:
Type
string

_isInterval(interval) → {boolean}

Parameters:
Name Type Description
interval Interval
Source:
Throws:
if interval is not of type Interval
Type
Error
Returns:
Type
boolean

(async) _scheduleInterval(id, interval, triggerOnceopt)

Parameters:
Name Type Attributes Default Description
id string
interval Interval
triggerOnce boolean <optional>
false Optional. Defaults to false.
Source:

addInterval(interval) → {this}

Parameters:
Name Type Description
interval Interval
Source:
Returns:
Type
this

addSchedule(schedule) → {this}

Calls addInterval() with the given Schedule.
Parameters:
Name Type Description
schedule Interval
Source:
Returns:
Type
this

getObservableForSchedule(interval) → {Observable.<IntervalEventSimple>}

Returns an Observable for the given Interval. Note that, for finished Intervals, an empty Observable is returned.
Parameters:
Name Type Description
interval Schedule | Interval Must be an instance of Interval
Source:
Returns:
Type
Observable.<IntervalEventSimple>

hasInterval(interval) → {boolean}

Parameters:
Name Type Description
interval Interval
Source:
Returns:
Type
boolean

hasSchedule(schedule) → {boolean}

Calls hasInterval() with the given Schedule.
Parameters:
Name Type Description
schedule Interval
Source:
Returns:
Type
boolean

(generator) preliminaryEvents(after, before) → {IterableIterator.<PreliminaryScheduleEvent.<Interval, undefined>>}

Parameters:
Name Type Description
after Date
before Date
Source:
Returns:
Type
IterableIterator.<PreliminaryScheduleEvent.<Interval, undefined>>

removeAllSchedules() → {Array.<Interval>}

Removes all Intervals and returns them. This will lead to the un-scheduling of all Intervals.
Source:
Returns:
Type
Array.<Interval>

removeInterval(interval) → {this}

Parameters:
Name Type Description
interval Interval
Source:
Returns:
Type
this

removeSchedule(schedule) → {this}

Calls removeInterval() with the given schedule.
Parameters:
Name Type Description
schedule Interval
Source:
Returns:
Type
this