WebAssembly / WebAssembly/WASI

outgoing-handler and valid request-options

Open
#813 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P-http S-inactive
Dominant language
Rust
Stars
5.8k
Forks
333
Avg merge
2d 13h
Merged PRs (30d)
3

Description

Presently, we have a record request-options full of optional timeout values, which is accepted as a parameter by outgoing-handler.handle. The three timeouts are for making the connection, first byte, and between bytes.

Some implementations, such as one implemented using Web fetch, will be not able to implement these timeouts faithfully. Should we specify that, if the options cannot be satisfied, these handlers return an error from handle? If so, we need an error variant, or some different error enum, that will report this properly.

One alternative in this design space is to make request-options a resource declared in the outgoing-handler interface. It can have a constructor taking no arguments named default, and for each timeout currently in the record, make a getter method that returns option, and a setter method that takes option and returns result. This allows the interface to deny an individual field. It also leaves the door open to worlds that can offer additional request options (e.g. enforce TLS, client certificates) the ability to add more setters and getters of the request-options type as standalone functions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the outgoing-handler.handle interface and the request-options record, focusing on the connection, first-byte, and between-bytes timeouts. Compare the proposed error variant with making request-options a resource whose setters can reject values. Done means the interface behavior and error or resource design are specified and agreed upon.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
backend-api-design, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.