new Interval(msecs, itemProduceropt, waitforFinishProduction, maxNumTriggers, triggerInitially, enabled)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
msecs |
Number | |||
itemProducer |
producerHandler.<(T|Promise.<T>)> |
<optional> |
null | Optional. Defaults to null. A function that produces an item that shall then be signaled by the scheduler. If the item is not of importance, then you may just supply an empty function or null (will be converted to an empty function then). |
waitforFinishProduction |
Boolean | true | if true, the interval will be reset only when the itemProducer finished producing its item. If this is false, the interval will be reset right away if it elapses. This makes sense if producing an item takes considerable amounts of time. | |
maxNumTriggers |
Number | the maximum amount of times this interval shall trigger. Supply a negative value or Number.MAX_SAFE_INTEGER to not limit this interval to any amount of occurrences. | ||
triggerInitially |
Boolean | if true, will trigger this interval right away, instead of waiting for the timeout to elapse once. | ||
enabled |
Boolean | if true, this Interval is enabled. Otherwise, its events are ignored until it get enabled. |
- Source:
Members
isFinished :Boolean
Type:
- Boolean
- Source:
Methods
finalize() → {this}
Additionally to finish(), this method also disables this Interval.
- Source:
Returns:
this
- Type
- this
finish() → {this}
This method will ultimately set the number of occurences equal to the
number of how many times this Interval should have been triggered.
This leads to this Interval reporting that it is finished.
Attempting to finish an unbounded Interval will throw an Error.
- Source:
Throws:
-
if this is an unbounded Interval
- Type
- Error
Returns:
this
- Type
- this
(generator) preliminaryEvents(after, before) → {IterableIterator.<PreliminaryScheduleEvent.<Interval, undefined>>}
Parameters:
Name | Type | Description |
---|---|---|
after |
Date | |
before |
Date |
- Source:
Returns:
- Type
- IterableIterator.<PreliminaryScheduleEvent.<Interval, undefined>>