gleam-lang / gleam-lang/fetch

Making requests with timeout

Open
#10 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Gleam
Stars
61
Forks
16
Avg merge
5d 20h
Merged PRs (30d)
1

Description

Specifying a timeout when making a web request seems like a core feature, otherwise your code is at the whim of whatever you're communicating with.

Usually I'd pass a `AbortSignal.timeout(time)` in the fetch options.

Another solution would be to race the promise with setTimeout. Doesn't look like the promises package exposed race functionality though.

Possibly linked with #4.. depending on the approach

Related:
https://github.com/gleam-lang/javascript/issues/11
https://github.com/gleam-lang/javascript/issues/10

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the fetch options and promises APIs described in the issue, then review #4 and the two linked JavaScript issues for the intended direction. Done means requests can honor a caller-specified timeout with documented behavior and coverage for the chosen approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.