Interface Task<Input, Result>

Source
Expand description

Captures a payload and a deferred result for batch processing.

interface Task<Input, Result> {
    input: Input;
    get state(): DeferredState;
    reject(reason?: any): void;
    resolve(value: Result | PromiseLike<Result>): void;
}

Properties§

Source§

public readonly input: Input

Accessors§

§

get state(): DeferredState

Gets the current state of the deferred promise.

Methods§

§

reject(reason?: any): void

Rejects the promise with a reason.

§

resolve(value: Result | PromiseLike<Result>): void

Resolves the promise with a value or the result of another promise.