Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IScheduler

A simple job scheduler API. You can add/remove jobs.

Hierarchy

  • IScheduler

Implemented by

Index

Methods

Methods

asap

  • Calls the function as soon as possible. Its a replacement for process.nextTick and is also cancellable. In non-node.js environments it fallbacks to various other techniques such as setTimeout or Promise.resolve.

    Type parameters

    • T: unknown[]

    Parameters

    • fn: function
        • (...t: T): unknown
        • Parameters

          • Rest ...t: T

          Returns unknown

    • Rest ...t: T

    Returns ICancellable

delay

  • delay<T, R>(fn: function, duration: number, ...t: T): ICancellable
  • Works exactly like setTimeout but also returns a ICancellable. Schedules the job to run after a certain period of time.

    Type parameters

    • T: unknown[]

    • R

    Parameters

    • fn: function
        • (...t: T): R
        • Parameters

          • Rest ...t: T

          Returns R

    • duration: number
    • Rest ...t: T

    Returns ICancellable

now

  • now(): number

Generated using TypeDoc