From ba8d90038dfce4e6f697c752c62c586571cdc71b Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Tue, 14 May 2024 10:55:14 -0500 Subject: [PATCH] wip: explore removing delays(6) --- src/Pipes.Node.Stream.purs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Pipes.Node.Stream.purs b/src/Pipes.Node.Stream.purs index 5413224..8141400 100644 --- a/src/Pipes.Node.Stream.purs +++ b/src/Pipes.Node.Stream.purs @@ -119,6 +119,8 @@ fromTransform t = maybeYield1 pure $ Loop { error, cancel } O.WriteWouldBlock -> do + queueLen <- liftEffect $ O.readableLength t + when (queueLen == 0) $ liftAff $ O.awaitReadableOrClosed t yieldWhileReadable liftAff $ O.awaitWritableOrClosed t pure $ Loop { error, cancel }