Class: TimerManager
@sapphire/timer-manager.TimerManager
Manages timers so that this application can be cleanly exited
Hierarchy
any
↳
TimerManager
Constructors
constructor
• new TimerManager()
Inherited from
null.constructor
Properties
storedIntervals
▪ Private
Static
storedIntervals: Set
<Timeout
>
A set of intervals to clear on destroy
Defined in
storedTimeouts
▪ Private
Static
storedTimeouts: Set
<Timeout
>
A set of timeouts to clear on destroy
Defined in
Methods
clearInterval
▸ Static
clearInterval(interval
): void
Clears an internal created through this class
Parameters
Name | Type | Description |
---|---|---|
interval | Timeout | The interval to clear |
Returns
void
Defined in
clearTimeout
▸ Static
clearTimeout(timeout
): void
Clears a timeout created through this class
Parameters
Name | Type | Description |
---|---|---|
timeout | Timeout | The timeout to clear |
Returns
void
Defined in
destroy
▸ Static
destroy(): void
Clears running timeouts and intervals created through this class so NodeJS can gracefully exit
Returns
void
Defined in
setInterval
▸ Static
setInterval<A
>(fn
, delay
, ...args
): Timeout
Creates an interval gets cleared when destroyed
Type parameters
Name | Type |
---|---|
A | unknown |
Parameters
Name | 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
▸ Static
setTimeout<A
>(fn
, delay
, ...args
): Timeout
Creates a timeout gets cleared when destroyed
Type parameters
Name | Type |
---|---|
A | unknown |
Parameters
Name | 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