(
fd: number,
nodeStream: SpawnedProcess["stdio"][number],
stream: Stream.Stream<Uint8Array, PlatformError.PlatformError> | undefined
)
| 406 | const outputStreams = new Map<number, Stream.Stream<Uint8Array, PlatformError.PlatformError>>() |
| 407 | |
| 408 | const setupInput = ( |
| 409 | fd: number, |
| 410 | nodeStream: SpawnedProcess["stdio"][number], |
| 411 | stream: Stream.Stream<Uint8Array, PlatformError.PlatformError> | undefined |
| 412 | ) => |
| 413 | Effect.suspend(() => { |
| 414 | let sink: Sink.Sink<void, Uint8Array, never, PlatformError.PlatformError> = Sink.drain |
| 415 | if (nodeStream && "write" in nodeStream) { |
| 416 | handleInputErrors(nodeStream) |
| 417 | sink = NodeSink.fromWritable({ |
| 418 | evaluate: () => nodeStream, |
| 419 | onError: (error) => toPlatformError(`fromWritable(fd${fd})`, toError(error), command) |
| 420 | }) |
| 421 | } |
| 422 | |
| 423 | if (stream) { |
| 424 | return Effect.map(runInputStream(stream, sink, inputFailure), () => { |
| 425 | inputSinks.set(fd, sink) |
| 426 | }) |
| 427 | } |
| 428 | |
| 429 | inputSinks.set(fd, sink) |
| 430 | return Effect.void |
| 431 | }) |
| 432 | |
| 433 | const setupOutput = ( |
| 434 | fd: number, |
no test coverage detected