• 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.

    Parameters

    • callback: (() => Promise<void>)

      The application code which should be executed at the given interval.

        • (): Promise<void>
        • Returns Promise<void>

    • interval: number = 5000

      The run interval in milliseconds.

    Returns (() => Promise<void>)

      • (): Promise<void>
      • Returns Promise<void>

Generated using TypeDoc