Class: TimerManager
Manages timers so that this application can be cleanly exited
Extends
any
Constructors
new TimerManager()
new TimerManager():
TimerManager
Returns
Inherited from
null.constructor
Properties
storedIntervals
privatestaticstoredIntervals:Set<Timeout>
A set of intervals to clear on destroy
Defined in
storedTimeouts
privatestaticstoredTimeouts:Set<Timeout>
A set of timeouts to clear on destroy
Defined in
Methods
clearInterval()
staticclearInterval(interval:Timeout):void
Clears an internal created through this class
Parameters
| Parameter | Type | Description |
|---|---|---|
interval | Timeout | The interval to clear |
Returns
void
Defined in
clearTimeout()
staticclearTimeout(timeout:Timeout):void
Clears a timeout created through this class
Parameters
| Parameter | Type | Description |
|---|---|---|
timeout | Timeout | The timeout to clear |
Returns
void
Defined in
destroy()
staticdestroy():void
Clears running timeouts and intervals created through this class so NodeJS can gracefully exit
Returns
void
Defined in
setInterval()
staticsetInterval<A>(fn: (...args:A[]) =>void,delay:number, ...args:A[]):Timeout
Creates an interval gets cleared when destroyed
Type Parameters
| Type Parameter | Default type |
|---|---|
A | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | (...args: A[]) => void | callback function |
delay | number | amount of time before running the callback |
...args | A[] | additional arguments to pass back to the callback |
Returns
Timeout
Defined in
setTimeout()
staticsetTimeout<A>(fn: (...args:A[]) =>void,delay:number, ...args:A[]):Timeout
Creates a timeout gets cleared when destroyed
Type Parameters
| Type Parameter | Default type |
|---|---|
A | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | (...args: A[]) => void | callback function |
delay | number | amount of time before running the callback |
...args | A[] | additional arguments to pass back to the callback |
Returns
Timeout