Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/async/abortable.ts>abortable

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function abortable
import { abortable } from "https://deno.land/std@0.131.0/async/abortable.ts";

Make Promise or AsyncIterable abortable with the given signal.

Parameters

p: Promise<T>
signal: AbortSignal

Returns

Promise<T>

Parameters

p: AsyncIterable<T>
signal: AbortSignal

Returns

AsyncGenerator<T>

Parameters

p: Promise<T> | AsyncIterable<T>
signal: AbortSignal

Returns

Promise<T> | AsyncIterable<T>