Skip to content

Change how async stream/future results are encoded#1273

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:update-stream-future-result-encoding
Apr 15, 2025
Merged

Change how async stream/future results are encoded#1273
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:update-stream-future-result-encoding

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

ReturnCode::Cancelled(0) => Ok((StreamResult::Cancelled, buf)),

amt => {
ReturnCode::Completed(amt) | ReturnCode::Closed(amt) | ReturnCode::Cancelled(amt) => {
Copy link
Copy Markdown
Member Author

@alexcrichton alexcrichton Apr 15, 2025

Choose a reason for hiding this comment

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

I'll note that for now I've opted to just lose information for here as it's in theory harmless. For example if a stream is closed after transferring N items then future writes should in theory not even hit the host and immediately say "nope it's close", or perhaps the state is reflected in the return value where the stream is consumed. I don't think it's super important to expose these states just yet so I've left that for a future update.

@alexcrichton alexcrichton enabled auto-merge April 15, 2025 20:16
@alexcrichton alexcrichton added this pull request to the merge queue Apr 15, 2025
Merged via the queue into bytecodealliance:main with commit b8d39b3 Apr 15, 2025
18 checks passed
@alexcrichton alexcrichton deleted the update-stream-future-result-encoding branch April 15, 2025 20:45
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