Skip to content

feat: add AsyncThrowingStream piping and completion utilities#156

Merged
pepicrft merged 1 commit intomainfrom
12-27-add_convenient_apis_to_work_with_the_asyncthrowingstream
Dec 30, 2024
Merged

feat: add AsyncThrowingStream piping and completion utilities#156
pepicrft merged 1 commit intomainfrom
12-27-add_convenient_apis_to_work_with_the_asyncthrowingstream

Conversation

@pepicrft
Copy link
Copy Markdown
Contributor

@pepicrft pepicrft commented Dec 27, 2024

TL;DR

Added stream piping functionality and completion handling to AsyncThrowingStream

What changed?

  • Added pipedStream() method to pipe standard output and error through the process' standard output and error
  • Added awaitCompletion() method to wait for stream completion
  • Migrated CI to use macos-15 runner and simplified Swift setup
  • Removed explicit Xcode version management
  • Updated tests to use the new Testing framework

How to test?

  1. Run a command with pipedStream() to verify output is correctly piped:
try await CommandRunner()
    .run(arguments: ["echo", "foo"])
    .pipedStream()
    .awaitCompletion()
  1. Verify the output appears in the standard output
  2. Run existing tests to ensure concatenatedString functionality remains intact

Why make this change?

To provide better control over command output handling by allowing direct piping to standard streams and providing a way to wait for stream completion without needing to manually consume the stream.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@pepicrft pepicrft changed the title Add convenient APIs to work with the AsyncThrowingStream feat: add AsyncThrowingStream piping and completion utilities Dec 27, 2024
@pepicrft pepicrft added the enhancement New feature or request label Dec 27, 2024 — with Graphite App
@pepicrft pepicrft marked this pull request as ready for review December 27, 2024 15:34
@pepicrft pepicrft force-pushed the 12-27-add_convenient_apis_to_work_with_the_asyncthrowingstream branch 2 times, most recently from 3815e39 to 2139fa8 Compare December 27, 2024 15:46
@pepicrft pepicrft force-pushed the 12-27-add_convenient_apis_to_work_with_the_asyncthrowingstream branch from 2139fa8 to 8c767a8 Compare December 27, 2024 15:48
@pepicrft pepicrft merged commit 98668f8 into main Dec 30, 2024
@pepicrft pepicrft deleted the 12-27-add_convenient_apis_to_work_with_the_asyncthrowingstream branch December 30, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants