feat(sandbox): support streaming stdin in runFS#363
Open
snowyu wants to merge 3 commits into
Open
Conversation
- Extend runFS to accept AsyncIterable, ReadableStream, or factory functions for stdin. - Implement UTF-8 safe chunking logic to prevent character corruption when splitting large inputs across buffer boundaries. - Refactor runFS to utilize WASIWorkerHost directly for asynchronous stdin streaming. - Add comprehensive unit tests covering various streaming scenarios, large payloads, and multi-byte UTF-8 character safety.
…te a new `langs` directory inside the existing one.
…nd backpressure support - Unify stdin handling logic for both string and stream inputs in runFS. - Add timeout support and error propagation for streaming stdin. - Improve WASIWorkerHost with isRunning state to prevent hangs during worker termination. - Implement UTF-8 safe chunking and filter empty chunks to prevent premature EOF. - Add comprehensive stress tests for backpressure and factory functions. - Update README with streaming stdin documentation and examples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for streaming stdin (AsyncIterable, ReadableStream, and factory functions) to runFS and runCode.
Key improvements:
Closes #362