WebAssembly / WebAssembly/WASI

[v1.0] pass `request-options` to `outgoing-handler` by `borrow`

Open
#796 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In 0.2, outgoing-handler gets passed an option<request-options>:

  @since(version = 0.2.0)
  handle: func(
    request: outgoing-request,
    options: option<request-options>
  ) -> result<future-incoming-response, error-code>;

It would be nice if this was instead an option<borrow<request-options>> so that the same options could be reused across many requests.

We can't change this in 0.2 because it would be a breaking change, but we should take the opportunity to fix it in 0.3.

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

The issue identifies the outgoing-handler WIT definition and the request-options type, but names no file or test path. Start by locating the v0.3 interface definition and reviewing how borrowed request-options values are represented. Done means the v0.3 API passes reusable borrowed options while preserving the existing 0.2 signature.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.