/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/testdata/run/stdin_readable_cancel.ts
15 строк
324 B
em
fix(ext/io): cancel pending readable stream reads (#34986)
07 июн 2026, 21:03
Не верифицирован
07 июн 2026, 21:03
53b969f
Код
Авторство
О чём код?
const reader = Deno.stdin.readable.getReader(); setTimeout(async () => { await reader.cancel("done"); console.log("CANCELLED"); }, 250); try { await reader.read(); } catch { // The pending read is interrupted by canceling the reader. } await new Promise((resolve) => setTimeout(resolve, 0)); console.log("DONE");