Skip to content

Commit 3d83715

Browse files
committed
Using pauseWhen
1 parent 0a2bf8c commit 3d83715

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs2/src/jsonrpclib/fs2/FS2Channel.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ object FS2Channel {
4949
impl = new Impl(awaitingSink, ref, isOpen, supervisor)
5050
_ <- Stream(()).concurrently {
5151
// Gatekeeping the pull until the channel is actually marked as open
52-
val wait = isOpen.waitUntil(identity)
53-
payloadStream.evalTap(_ => wait).evalMap(impl.handleReceivedPayload)
52+
payloadStream.pauseWhen(isOpen.map(b => !b)).evalMap(impl.handleReceivedPayload)
5453
}
5554
} yield impl
5655
}

0 commit comments

Comments
 (0)