Skip to content

Commit aca4a7b

Browse files
authored
Merge pull request #86 from elliottt/trevor/future-trailers-get-once
Change future-trailers.get to produce at most one success
2 parents c6fb95f + 0636bcc commit aca4a7b

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

proxy.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,10 +1244,13 @@ the <code>get</code> method will return <code>some</code>.</p>
12441244
once the future is ready.</p>
12451245
<p>The outer <code>option</code> represents future readiness. Users can wait on this
12461246
<code>option</code> to become <code>some</code> using the <code>subscribe</code> method.</p>
1247-
<p>The <code>result</code> represents that either the HTTP Request or Response body,
1248-
as well as any trailers, were received successfully, or that an error
1249-
occured receiving them. The optional <a href="#trailers"><code>trailers</code></a> indicates whether or not
1250-
trailers were present in the body.</p>
1247+
<p>The outer <code>result</code> is used to retrieve the trailers or error at most
1248+
once. It will be success on the first call in which the outer option
1249+
is <code>some</code>, and error on subsequent calls.</p>
1250+
<p>The inner <code>result</code> represents that either the HTTP Request or Response
1251+
body, as well as any trailers, were received successfully, or that an
1252+
error occured receiving them. The optional <a href="#trailers"><code>trailers</code></a> indicates whether
1253+
or not trailers were present in the body.</p>
12511254
<p>When some <a href="#trailers"><code>trailers</code></a> are returned by this method, the <a href="#trailers"><code>trailers</code></a>
12521255
resource is immutable, and a child. Use of the <code>set</code>, <code>append</code>, or
12531256
<code>delete</code> methods will return an error, and the resource must be
@@ -1258,7 +1261,7 @@ dropped before the parent <a href="#future_trailers"><code>future-trailers</code
12581261
</ul>
12591262
<h5>Return values</h5>
12601263
<ul>
1261-
<li><a name="method_future_trailers.get.0"></a> option&lt;result&lt;option&lt;own&lt;<a href="#trailers"><a href="#trailers"><code>trailers</code></a></a>&gt;&gt;, <a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>&gt;&gt;</li>
1264+
<li><a name="method_future_trailers.get.0"></a> option&lt;result&lt;result&lt;option&lt;own&lt;<a href="#trailers"><a href="#trailers"><code>trailers</code></a></a>&gt;&gt;, <a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>&gt;&gt;&gt;</li>
12621265
</ul>
12631266
<h4><a name="constructor_outgoing_response"><code>[constructor]outgoing-response: func</code></a></h4>
12641267
<p>Construct an <a href="#outgoing_response"><code>outgoing-response</code></a>, with a default <a href="#status_code"><code>status-code</code></a> of <code>200</code>.

wit/types.wit

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,16 +437,20 @@ interface types {
437437
/// The outer `option` represents future readiness. Users can wait on this
438438
/// `option` to become `some` using the `subscribe` method.
439439
///
440-
/// The `result` represents that either the HTTP Request or Response body,
441-
/// as well as any trailers, were received successfully, or that an error
442-
/// occured receiving them. The optional `trailers` indicates whether or not
443-
/// trailers were present in the body.
440+
/// The outer `result` is used to retrieve the trailers or error at most
441+
/// once. It will be success on the first call in which the outer option
442+
/// is `some`, and error on subsequent calls.
443+
///
444+
/// The inner `result` represents that either the HTTP Request or Response
445+
/// body, as well as any trailers, were received successfully, or that an
446+
/// error occured receiving them. The optional `trailers` indicates whether
447+
/// or not trailers were present in the body.
444448
///
445449
/// When some `trailers` are returned by this method, the `trailers`
446450
/// resource is immutable, and a child. Use of the `set`, `append`, or
447451
/// `delete` methods will return an error, and the resource must be
448452
/// dropped before the parent `future-trailers` is dropped.
449-
get: func() -> option<result<option<trailers>, error-code>>;
453+
get: func() -> option<result<result<option<trailers>, error-code>>>;
450454
}
451455

452456
/// Represents an outgoing HTTP Response.

0 commit comments

Comments
 (0)