Skip to content

Commit

Permalink
update multiplexed demux
Browse files Browse the repository at this point in the history
  • Loading branch information
leonitousconforti committed Oct 22, 2024
1 parent 54eb77f commit 1b10c61
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/demux/Multiplexed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,7 @@ export const demuxMultiplexedSocket: {
Stream.map(({ messageBuffer, messageType }) =>
Tuple.make(messageType, Chunk.toReadonlyArray(messageBuffer))
),
Stream.flatMap(Schema.decodeUnknown(MultiplexedStreamSocketSchema)),
Stream.filter(
([messageType]) =>
messageType === MultiplexedStreamSocketHeaderType.Stdout ||
messageType === MultiplexedStreamSocketHeaderType.Stderr
)
Stream.flatMap(Schema.decodeUnknown(MultiplexedStreamSocketSchema))
);

if (!willPartition) {
Expand All @@ -290,7 +285,9 @@ export const demuxMultiplexedSocket: {

return Function.pipe(
untilPartition,
Stream.partition(([messageType]) => messageType === MultiplexedStreamSocketHeaderType.Stdout, options),
Stream.partition(([messageType]) => messageType !== MultiplexedStreamSocketHeaderType.Stderr, {
bufferSize: options?.bufferSize,
}),
Effect.map(
Tuple.mapBoth({
onFirst: Function.flow(
Expand Down

0 comments on commit 1b10c61

Please sign in to comment.