Interface Allotment<TWork>

Work allotment.

Provided by workbench to workload allocator to allocate the work.

Type Parameters

  • TWork

    A work type performed by target workload.

Hierarchy

  • SupplyPeer
    • Allotment

Properties

Methods

Properties

supply: Supply

The work allotment supply.

Once cut off the work is disposed. No more tasks would be accepted after that, while pending ones would fail.

workbench: Workbench

A workbench the work is allocated within.

workload: Workload<TWork>

A workload to allocate the work for.

Methods

  • Runs the task as part of the work.

    Type Parameters

    • TResult

      A type of task result.

    Parameters

    • task: Task<TResult>

      A task to run.

    Returns Promise<TResult>

    A promise resolved to task result, or rejected if the work is disposed already.

Generated using TypeDoc