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

Update SF-0007 to version 4 #496

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iCharlesHu
Copy link
Contributor

  • v4: Minor updates (mostly name changes):
    • Dropped the executing label from .run().
    • Removed the references to Subprocess.AsyncBytes:
      • Instead, we use opaque type: some AsyncSequence<UInt8, Error>.
      • When typed throws is ready, we can then update to the actual error type.
    • Updated .standardOutput and .standardError properties on Subprocess and CollectedResult to be non-optional (now they use fatalError instead).
      • Rationale: These properties can only be nil in two cases:
        1. The corresponding .output/.error was not set to .redirectToSequence when run() was called.
        2. These properties are accessed multiple times. This is because these AsyncSequences are reading pipes under the hood, and pipes can only be read once.
      • Both cases can't be resolved until the source code is updated; they are therefore considered programming errors.
    • Updated StandardInputWriter to be non-sendable.
    • Renamed PlatformOptions.additionalAttributeConfigurator to Platform.preSpawnAttributeConfigurator; renamed PlatformOptions.additionalFileAttributeConfigurator to Platform.preSpawnFileAttributeConfigurator.
    • Updated all closeWhenDone parameter labels to closeAfterProcessSpawned.
    • Renamed Subprocess.Result to Subprocess.ExecutionResult.
    • Added Codable support to TerminationStatus and ExecutionResult.
    • Renamed TerminationStatus.exit:
      • From .exit to .exited.
      • From .wasUnhandledException to .isUnhandledException.
    • Added two sections under Future Direction: Support Launching Long Running Processes and Process Piping

@iCharlesHu iCharlesHu added the proposal This PR is for a proposal label Mar 20, 2024
@iCharlesHu iCharlesHu force-pushed the charles/subprocess-proposal-v4 branch from fabf023 to 8a84707 Compare March 29, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal This PR is for a proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant