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
Properties
Section titled “Properties”Promise
Section titled “Promise”public Task<T> Promise { get; }The task that completes on Resolve(%600) or faults on Exception).
Value: Task<T>
Methods
Section titled “Methods”IsPending()
Section titled “IsPending()”public bool IsPending()True before resolve or reject.
Returns: bool
IsRejected()
Section titled “IsRejected()”public bool IsRejected()True after Exception).
Returns: bool
IsResolved()
Section titled “IsResolved()”public bool IsResolved()True after Resolve(%600).
Returns: bool
Reject(Exception)
Section titled “Reject(Exception)”public void Reject(Exception error)Faults Promise with <code class=“paramref”>error</code>.
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
Resolve(T)
Section titled “Resolve(T)”public void Resolve(T value)Completes Promise with <code class=“paramref”>value</code>.
Parameters
| Name | Type | Description |
|---|---|---|
value |
T |
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product