Skip to content

DelayedPromise<T>

Namespace: Vercel.AI.ProviderUtils

public sealed class DelayedPromise<T>

A task that is completed from outside. Maps to DelayedPromise.

Type parameters

Name Description
T

Inheritance: object

View source

public Task<T> Promise { get; }

The task that completes on Resolve(%600) or faults on Exception).

Value: Task<T>

View source

public bool IsPending()

True before resolve or reject.

Returns: bool

View source

public bool IsRejected()

True after Exception).

Returns: bool

View source

public bool IsResolved()

True after Resolve(%600).

Returns: bool

View source

public void Reject(Exception error)

Faults Promise with <code class=“paramref”>error</code>.

Parameters

Name Type Description
error Exception

View source

public void Resolve(T value)

Completes Promise with <code class=“paramref”>value</code>.

Parameters

Name Type Description
value T

View source

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