Wasm Directoryalpha
Resource

future-incoming-response

Represents a future which may eventaully return an incoming HTTP Response, or an error.

resource future-incoming-response;

F subscribe

subscribe: func() -> pollable;

Returns a pollable which becomes ready when either the Response has been received, or an error has occured. When this pollable is ready, the get method will return some.

F get

get: func() -> option​<result​<result​<incoming-response, error-code>, _>>;

Returns the incoming HTTP Response, or an error, once one is ready.

The outer option represents future readiness. Users can wait on this option to become some using the subscribe method.

The outer result is used to retrieve the response or error at most once. It will be success on the first call in which the outer option is some, and error on subsequent calls.

The inner result represents that either the incoming HTTP Response status and headers have recieved successfully, or that an error occured. Errors may also occur while consuming the response body, but those will be reported by the incoming-body and its output-stream child.