Skip to content

Commit 4342002

Browse files
authored
Merge pull request #61 from orlandos-nl/jo/buffer-stream-data
Make sure that data is buffered instead of discarded
2 parents 7a37e82 + 22c969a commit 4342002

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Citadel/TTY/Client/TTY.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ extension SSHClient {
155155
/// - inShell: Whether to request the remote server to start a shell before executing the command.
156156
public func executeCommandStream(_ command: String, inShell: Bool = false) async throws -> AsyncThrowingStream<ExecCommandOutput, Error> {
157157
var streamContinuation: AsyncThrowingStream<ExecCommandOutput, Error>.Continuation!
158-
let stream = AsyncThrowingStream<ExecCommandOutput, Error> { continuation in
158+
let stream = AsyncThrowingStream<ExecCommandOutput, Error>(bufferingPolicy: .unbounded) { continuation in
159159
streamContinuation = continuation
160160
}
161161

@@ -218,11 +218,11 @@ extension SSHClient {
218218
public func executeCommandPair(_ command: String, inShell: Bool = false) async throws -> ExecCommandStream {
219219
var stdoutContinuation: AsyncThrowingStream<ByteBuffer, Error>.Continuation!
220220
var stderrContinuation: AsyncThrowingStream<ByteBuffer, Error>.Continuation!
221-
let stdout = AsyncThrowingStream<ByteBuffer, Error> { continuation in
221+
let stdout = AsyncThrowingStream<ByteBuffer, Error>(bufferingPolicy: .unbounded) { continuation in
222222
stdoutContinuation = continuation
223223
}
224224

225-
let stderr = AsyncThrowingStream<ByteBuffer, Error> { continuation in
225+
let stderr = AsyncThrowingStream<ByteBuffer, Error>(bufferingPolicy: .unbounded) { continuation in
226226
stderrContinuation = continuation
227227
}
228228

0 commit comments

Comments
 (0)