Skip to main content
Module

x/timeout/mod.ts>Timeout.race

Abortable promise timeout for Deno
Latest
function Timeout.race
import { Timeout } from "https://deno.land/x/timeout@2.4/mod.ts";
const { race } = Timeout;

Shortcut for racing the given promises with a timeout that rejects whith TimeoutError when timed out

Parameters

promises: Promise<T>[]

Promises to race with the timeout

delay: number

Milliseconds to wait