Skip to content

SetAbortTimeout

Namespace: Vercel.AI.Util

public static class SetAbortTimeout

Schedules an abort when a timeout elapses.

Inheritance: object

View source

Schedule(AbortController?, string?, int?, Action<Action, int>?)

Section titled “Schedule(AbortController?, string?, int?, Action<Action, int>?)”
public static IDisposable? Schedule(AbortController? abortController, string? label, int? timeoutMs, Action<Action, int>? schedule = null)

Aborts <code class=“paramref”>abortController</code> after <code class=“paramref”>timeoutMs</code> with a TimeoutError whose message includes <code class=“paramref”>label</code>. Returns null when the controller or timeout is missing. Disposing the result cancels the abort.

Parameters

Name Type Description
abortController AbortController
label string
timeoutMs int?
schedule Action<Action, int>

Returns: IDisposable

View source

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