Class: TimerManager
Defined in: timer-manager/dist/esm/index.d.mts:4
Manages timers so that this application can be cleanly exited
Extends
- any
Constructors
Constructor
new TimerManager():
TimerManager
Returns
TimerManager
Inherited from
null.constructor
Properties
storedIntervals
privatestaticstoredIntervals:any
Defined in: timer-manager/dist/esm/index.d.mts:12
A set of intervals to clear on destroy
storedTimeouts
privatestaticstoredTimeouts:any
Defined in: timer-manager/dist/esm/index.d.mts:8
A set of timeouts to clear on destroy
Methods
clearInterval()
staticclearInterval(interval:Timeout):void
Defined in: timer-manager/dist/esm/index.d.mts:36
Clears an internal created through this class
Parameters
| Parameter | Type | Description | 
|---|---|---|
| interval | Timeout | The interval to clear | 
Returns
void
clearTimeout()
staticclearTimeout(timeout:Timeout):void
Defined in: timer-manager/dist/esm/index.d.mts:24
Clears a timeout created through this class
Parameters
| Parameter | Type | Description | 
|---|---|---|
| timeout | Timeout | The timeout to clear | 
Returns
void
destroy()
staticdestroy():void
Defined in: timer-manager/dist/esm/index.d.mts:40
Clears running timeouts and intervals created through this class so NodeJS can gracefully exit
Returns
void
setInterval()
staticsetInterval<A>(fn: (...args:A[]) =>void,delay:number, ...args:A[]):Timeout
Defined in: timer-manager/dist/esm/index.d.mts:31
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
setTimeout()
staticsetTimeout<A>(fn: (...args:A[]) =>void,delay:number, ...args:A[]):Timeout
Defined in: timer-manager/dist/esm/index.d.mts:19
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