From cf591414ab9055b289cc074e6e67d9bbf722e34c Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 18 Apr 2023 08:27:03 -0700 Subject: [PATCH 1/3] Update types.wit with some documentation improvements. --- wit/types.wit | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wit/types.wit b/wit/types.wit index b45897b..bb8f97e 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -73,6 +73,10 @@ default interface types { // a single `request` type (that uses the single `stream` type mentioned // above). The `consume` and `write` methods may only be called once (and // return failure thereafter). + // The streams returned by `consume` and `write` are owned by the request and + // response objects. The streams are destroyed when the request/response is + // dropped. The caller can also call drop on the stream before the + // request/response is dropped if they want to release resources earlier. type incoming-request = u32 type outgoing-request = u32 drop-incoming-request: func(request: incoming-request) From 0d75f240d75a7eb082eadacc7549e8d35e9737d9 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 27 Jun 2023 08:13:23 -0700 Subject: [PATCH 2/3] Update types.wit --- wit/types.wit | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/wit/types.wit b/wit/types.wit index 0da3080..f4a8b1f 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -86,13 +86,12 @@ interface types { // The following block defines the `incoming-request` and `outgoing-request` // resource types that correspond to HTTP standard Requests. Soon, when - // resource types are added, the `u32` type aliases can be replaced by - // proper `resource` type definitions containing all the functions as - // methods. Later, Preview2 will allow both types to be merged together into - // a single `request` type (that uses the single `stream` type mentioned - // above). The `consume` and `write` methods may only be called once (and - // return failure thereafter). - // The `headers` and `trailers` passed into and out of requests + // resource types are added, the `u32` type aliases can be replaced by proper + // `resource` type definitions containing all the functions as methods. + // Later, Preview2 will allow both types to be merged together into a single + // `request` type (that uses the single `stream` type mentioned above). The + // `consume` and `write` methods may only be called once (and return failure + // thereafter). The `headers` and `trailers` passed into and out of requests // are shared with the request, with all mutations visible to all uses. // Components MUST avoid updating `headers` and `trailers` after passing a // request that points to them to the outside world. From 5860cd2a4a246c92ba32a5e29f81c71f6f87fb14 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Thu, 27 Jul 2023 20:45:22 -0700 Subject: [PATCH 3/3] Update wit/types.wit Co-authored-by: Luke Wagner --- wit/types.wit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wit/types.wit b/wit/types.wit index f4a8b1f..6d92a88 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -97,7 +97,9 @@ interface types { // request that points to them to the outside world. // The streams returned by `consume` and `write` are owned by the request and // response objects. The streams are destroyed when the request/response is - // dropped. The caller can also call drop on the stream before the + // dropped, thus a client MUST drop any handle referring to a request/response stream + // before dropping the request/response or passing ownership of the request/response + // to the outside world. The caller can also call drop on the stream before the // request/response is dropped if they want to release resources earlier. type incoming-request = u32 type outgoing-request = u32