- build(callback: (() => Promise<void>), interval?: number): (() => Promise<void>)
-
Parameters
-
callback: (() => Promise<void>)
-
- (): Promise<void>
-
Returns Promise<void>
-
interval: number = 5000
Returns (() => Promise<void>)
-
- (): Promise<void>
-
Returns Promise<void>
Build a new background service which pauses for interval between runs.
Won't crash when the worker throws.
When the application is going to shut down any running callbacks will be run to the end. Any pending callbacks will be cancelled.