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

refactor(BREAKING): command pipe writes may now return a promise #225

Merged
merged 2 commits into from
Jan 27, 2024

Conversation

dsherret
Copy link
Owner

@dsherret dsherret commented Jan 27, 2024

Before:

export interface CommandPipeWriter extends WriterSync {
  writeSync(p: Uint8Array): number;
  writeText(text: string): void;
  writeLine(text: string): void;
}

After:

export interface CommandPipeWriter {
  write(p: Uint8Array): Promise<number> | number;
  writeText(text: string): Promise<void> | void;
  writeLine(text: string): Promise<void> | void;
}

For performance, check if the write in a command returns a promise. If it does, then continue async, otherwise continue sync.

Closes #224

@dsherret dsherret changed the title refactor(BREAKING): shell pipe writes may now return a promise refactor(BREAKING): command pipe writes may now return a promise Jan 27, 2024
@dsherret dsherret merged commit c3128fc into main Jan 27, 2024
4 checks passed
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.

Redesign command and internal streams
1 participant