Skip to content

PendingPromise<T>

Namespace: Vercel.AI.Operations

public sealed class PendingPromise<T>

A promise that can be resolved once.

Type parameters

Name Description
T

Inheritance: object

View source

public bool IsPending { get; }

True until Resolve(%600) or Exception).

Value: bool

View source

public bool IsResolved { get; }

True after Resolve(%600).

Value: bool

View source

public Task<T> Task { get; }

The underlying task.

Value: Task<T>

View source

public void Reject(Exception error)

Rejects the promise when it is still pending.

Parameters

Name Type Description
error Exception

View source

public void Resolve(T value)

Resolves the promise when it is still pending.

Parameters

Name Type Description
value T

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product