Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fields, timeout, and incoming handler signature changes #66

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

elliottt
Copy link
Collaborator

@elliottt elliottt commented Oct 31, 2023

This PR includes a number of changes that we've discussed independently, all bundled up into one:

  • The request-options record has been turned into a resource, which allows for two new capabilities: embedders can clearly indicate when timeouts are not supported by returning None from a setter; the spec can evolve without breaking older guests, as new methods can be added without breaking compatibility.
  • The response-outparam.set method has had its result type removed. In general the intent is that any validation of the status code and headers should occur before set is called, and that validation was the only need for the result return type.
  • The future-trailers.get method now returns an option<trailers> value on success, which allows for the presence of trailers in hte request to be clearly indicated. Previously the absence of trailers was indicated by returning an empty fields, and now it's indicated by returning a none value.
  • The fields.set and fields.append methods have had their return values modified to indicate potential failure, which is allowed to happen in the cases outlined by the header-error variant. Additionally, as we now can raise errors for header names and values, the constructor has been modified to no longer accept a list of key/value pairs. The fields.from-list method was added to allow for this use-case, and returns a result that can indicate if there was a problem with one of the header name/value entries.

@elliottt elliottt marked this pull request as ready for review October 31, 2023 18:49
@elliottt
Copy link
Collaborator Author

I'm not sure why the monotonic-clock.{duration} use is failing, is it pulling it in from an upstream repo that hasn't been updated yet?

@pchickey
Copy link
Contributor

Yes, duration has not landed in wasi-clocks yet, that needs to merge and then we need to run wit-deps update.

Copy link
Member

@lukewagner lukewagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (assuming build errors re: duration are resolved)

wit/types.wit Outdated Show resolved Hide resolved
@pchickey
Copy link
Contributor

pchickey commented Nov 1, 2023

I just merged the latest wit deps to main, so if you merge (and then regenerate your markdown) you'll have duration available.

@elliottt elliottt merged commit 473c901 into WebAssembly:main Nov 1, 2023
1 check passed
@elliottt elliottt deleted the trevor/updates branch December 5, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants