Adding an interface to query readiness to accept requests
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- wasm
- Domain
- api
Research direction
Start by reading the proposed service world in issue #793 and compare it with the proxy and handler interfaces. Review the readiness WIT draft and the discussion about request back pressure, concurrency, and outbound HTTP applicability. Done means reaching agreement on the interface location and semantics, including the result cases and blocking behavior.
Written by the indexing model from the issue text.
Description
This would serve a few purposes:
-
As an instance reuse "handshake" between the caller and handler, allowing e.g. a host to drop an instance that won't accept any further requests or a guest to eagerly perform some expensive state reset.
-
As a form of flow control (back pressure) for entire requests. This is useful in load-balancer-like situations where the sender wants to pick from only handler(s) that are ready to process a request.
-
A way for handlers to explicitly signal concurrency support.
A rough draft:
interface readiness {
/// May be called to query the handler's readiness to accept request(s).
/// - Blocks if the handler is not ready to accept any more requests but may become ready in the future.
/// - Returns `ok(n)` when the handler is ready to accept up to `n` concurrent requests.
/// - Returns `err` if this instance won't ever accept another request (instead of exiting).
/// - Returns `ok(0)` if the handler cannot report its readiness; the caller will just have to take
/// its chances on `handle` blocking (maybe better as an error variant?).
ready: async func() -> result<u32>;
}
This would be added to the proxy world or the proposed service world. Alternatively this function could be added to the handler interface, though I'm not sure that it is applicable to generic "outbound http" imports.
- Dominant language
- Rust
- Stars
- 5.8k
- Forks
- 333
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/WASI
-
[http] Request and Response's `new` method is reserved in many languages, inconsistent with sockets. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
WebAssembly/WASI#961 ·
-
P-http
Difficulty 1/5 Under an hour Newbie friendliness 90/100
WebAssembly/WASI#937 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
WebAssembly/WASI#909 ·
-
P-clocks S-inactive
Difficulty 1/5 Under an hour Newbie friendliness 68/100
WebAssembly/WASI#687 ·
-
P-random S-inactive
Difficulty 1/5 Under an hour Newbie friendliness 75/100
WebAssembly/WASI#701 ·
All issues in WebAssembly/WASI
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug team:backend track:services-maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cowprotocol/services#4950 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·