Skip to content

Example of aborting fetch with an AbortController and CancellationToken#104

Open
kjvalencik wants to merge 1 commit intomainfrom
kv/fetch-abort
Open

Example of aborting fetch with an AbortController and CancellationToken#104
kjvalencik wants to merge 1 commit intomainfrom
kv/fetch-abort

Conversation

@kjvalencik
Copy link
Copy Markdown
Member

Example of adapting a JavaScript AbortController to a tokio CancellationToken.

TODO: Include docs on how this works.

Usage

# default 1s timeout
$ node test.js
2026-03-03

# short timeout
$ node test.js 10
[Error: Request aborted]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant