Copilot/breakdown streamed output methods - #1
Open
jtenos wants to merge 6 commits into
Open
Conversation
…) methods Co-authored-by: jtenos <607782+jtenos@users.noreply.github.com>
…t multiple Done() calls Co-authored-by: jtenos <607782+jtenos@users.noreply.github.com>
…t internally Co-authored-by: jtenos <607782+jtenos@users.noreply.github.com>
Co-authored-by: jtenos <607782+jtenos@users.noreply.github.com>
Co-authored-by: jtenos <607782+jtenos@users.noreply.github.com>
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.
Implements two distinct usage patterns: stream-based writing with explicit completion via Done(), and WriteToString() methods as cleaner alternatives to OutputToString().
Changes
Stream-based API
##WriteToString() methods
##Internal changes
Examples
Stream-based writing:
String output:
All existing API methods remain unchanged and functional. Added 16 tests covering new functionality.
Original Prompt
For the first one, accept a stream in the Start method, and make a Done() method which flushes and disposees the underlying stream:
For the second one, keep the OutputTo... methods. Instead of a StringBuilder/StringWriter, use a MemoryStream so that you can use the same underlying technology as the first one.