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

enable stream/future payload lift/lower for non-Wasm platforms #1120

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

dicej
Copy link
Collaborator

@dicej dicej commented Jan 9, 2025

Previously, we generated no code for non-Wasm platforms; which meant our codegen tests weren't really testing much as far as streams and futures go. Now that the tests actually do something, they uncovered a few issues which I've fixed:

  • Invalid code generation when using duplicate_if_necessary: true
  • Invalid code generation for stream or futures whose payloads contain one or more a streams or futures

For the latter, I mimicked what we do for resources: use interior mutability to provide take_handle methods for StreamReader and FutureReader.

dicej added 2 commits January 9, 2025 16:26
Previously, we generated no code for non-Wasm platforms; which meant our codegen
tests weren't really testing much as far as streams and futures go.  Now that
the tests actually do something, they uncovered a few issues which I've fixed:

- Invalid code generation when using `duplicate_if_necessary: true`
- Invalid code generation for stream or futures whose payloads contain one or more a streams or futures

For the latter, I mimicked what we do for resources: use interior mutability to
provide `take_handle` methods for `StreamReader` and `FutureReader`.

Signed-off-by: Joel Dice <[email protected]>
Previously, we would optimistically lower all the values in the input array and
then re-lower the subset which wasn't accepted the first time.  Aside from being
inefficient, that was also incorrect since re-lowering would fail in the cases
of any resource handles, futures, or streams in the payload since we would have
already taken the handles using `take_handle`.

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej requested a review from alexcrichton January 10, 2025 14:39
@alexcrichton alexcrichton added this pull request to the merge queue Jan 10, 2025
Merged via the queue into main with commit 11b04d7 Jan 10, 2025
25 checks passed
@alexcrichton alexcrichton deleted the more-stream-future-fixes branch January 10, 2025 16:17
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.

2 participants