Skip to content

Commit 3e39a13

Browse files
committed
Review comments
1 parent c1686bb commit 3e39a13

1 file changed

Lines changed: 26 additions & 20 deletions

File tree

proposals/http/wit-0.3.0-draft/worlds.wit

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,33 @@ world service {
3636
///
3737
/// Hosts may concurrently invoke this `handler` interface multiple times,
3838
/// even when previous requests have yet to finish processing. This means that
39-
/// the guest, if it blocks, may be required to service multiple requests at
40-
/// the same time. Guests can opt-out of this behavior with component-model
41-
/// backpressure to avoid sending more requests to this instance while a
42-
/// previous one is being processed, however.
39+
/// the guest, if it becomes idle while being blocked on I/O, may be required
40+
/// to service multiple requests at the same time. Guests can opt-out of
41+
/// this behavior with component-model backpressure to avoid sending more
42+
/// requests to this instance while a previous one is being processed,
43+
/// however.
4344
///
44-
/// Another requirement that hosts place on guests implementing this
45-
/// interface, in addition to being able to concurrently invoke it, is that
46-
/// the guest sends outgoing HTTP requests, via the `client` import above
47-
/// or the `handler` import in the `middleware` world, in such a way that the
48-
/// host can accurately attribute which invocation of `handler` induced the
49-
/// outgoing HTTP request to be sent. This requirement enables embedders,
50-
/// for example, to correctly implement the CDN-Loop header automatically and
51-
/// ensure that outgoing requests correctly build on incoming requests. In
52-
/// general this is not a hard requirement that embedders can rely on, but
53-
/// well-behaved guests are expected to provide this guarantee. Hosts which
54-
/// require a hard guarantee regardless of guest will not invoke `handler`
55-
/// more than once concurrently. Guests which export `handler` are expected to
56-
/// ensure that calls to imported interfaces happen on the same component
57-
/// model task that the `handler` was originally invoked on. If guests cannot
58-
/// provide this guarantee then they're expected to opt-out of concurrent
59-
/// through the component model's backpressure mechanisms.
45+
/// In some contexts, correct attribution of resource usage and I/O operations
46+
/// is an important requirement. For example, correct implementation of the
47+
/// CDN-Loop header in the context of a proxy server requires that outgoing
48+
/// HTTP requests can be attributed to the incoming HTTP request that induced
49+
/// them.
50+
///
51+
/// Hosts with this requirement must associate work happening on the same
52+
/// component model task that the `handler` was originally invoked on with the
53+
/// same incoming HTTP request.
54+
///
55+
/// Conversely, guests must ensure that calls to imported interfaces happen on
56+
/// the same component model task that the `handler` was originally invoked
57+
/// on. Guest runtime implementations that do not provide this guarantee are
58+
/// expected to opt-out of concurrent through the component model's
59+
/// backpressure mechanisms.
60+
///
61+
/// Note that hosts can't rely on this guarantee being upheld by all guests,
62+
/// and shouldn't treat it as part of their security model. Instead, the
63+
/// combination of the above host and guest requirements enable hosts to
64+
/// enforce correctness properties on behalf of the overall system a guest is
65+
/// part of.
6066
export handler;
6167
}
6268

0 commit comments

Comments
 (0)