Class TaskBucket<T>

Type Parameters

  • T = any

Constructors

  • Type Parameters

    • T = any

    Parameters

    • options: TaskBucketOptions

    Returns TaskBucket<T>

Properties

name: string
pluginId: null | string

Methods

  • Delete all tasks within this bucket

    Returns Promise<number>

    the number of tasks deleted

  • Delete a task by its globally unique ID (NOT key)

    Throws an error if it did not belong to this bucket

    Parameters

    • id: number

    Returns Promise<boolean>

    true if found and deleted, false otherwise

  • Delete a task by its unique key

    Parameters

    • key: string

    Returns Promise<boolean>

    true if found and deleted, false otherwise

  • Retrieve a task by its globally unique ID (NOT unique key)

    Parameters

    • id: number

    Returns Promise<undefined | Task<T>>

    The task if found, or undefined if not found

  • Retrieve a task by its unique key

    Parameters

    • key: string

    Returns Promise<undefined | Task<T>>

    Either the task if found, or undefined

  • Paginate through all scheduled tasks in this bucket

    Note that only a small number is returned each call (25 as of writing, may change) so if you need to scan through all of them you need to paginate using BucketListOptions.afterId

    Entries are sorted by increasing ID

    Parameters

    Returns Promise<Task<T>[]>

  • Create a new scheduled task.

    Parameters

    Returns Promise<Task<T>>

    The scheduled task

Generated using TypeDoc