Creates new instance of the timer and sets its values.
(optional) a Notifiable object or callback function to call when timer is triggered.
(optional) an interval to trigger timer in milliseconds.
(optional) a delay before the first triggering in milliseconds.
Closes the timer.
This is required by [[ICloseable]] interface, but besides that it is identical to stop().
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Gets the callback function that is called when this timer is triggered.
the callback function or null if it is not set.
Gets initial delay before the timer is triggered for the first time.
the delay in milliseconds.
Gets periodic timer triggering interval.
the interval in milliseconds
Gets the INotifiable object that receives notifications from this timer.
the INotifiable object or null if it is not set.
Checks if the timer is started.
true if the timer is started and false if it is stopped.
Sets the callback function that is called when this timer is triggered.
the callback function to be called.
Sets initial delay before the timer is triggered for the first time.
a delay in milliseconds.
Sets periodic timer triggering interval.
an interval in milliseconds.
Sets a new INotifiable object to receive notifications from this timer.
a INotifiable object to be triggered.
Starts the timer.
Initially the timer is triggered after delay. After that it is triggered after interval until it is stopped.
Stops the timer.
Generated using TypeDoc
Timer that is triggered in equal time intervals.
It has summetric cross-language implementation and is often used by Pip.Services toolkit to perform periodic processing and cleanup in microservices.
INotifiable
Example
class MyComponent { private timer: FixedRateTimer = new FixedRateTimer(() => { this.cleanup }, 60000); ... public open(correlationId: string, callback: (err: any) => void): void { ... timer.start(); ... } public open(correlationId: string, callback: (err: any) => void): void { ... timer.stop(); ... } private cleanup(): void { ... } ... }