Skip to content

Commit a513a7d

Browse files
committed
Force outgoing messages to wait too
1 parent 6cb6f65 commit a513a7d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs2/src/jsonrpclib/fs2/FS2Channel.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ object FS2Channel {
4848
supervisor <- Stream.resource(Supervisor[F])
4949
ref <- Ref[F].of(State[F](Map.empty, endpointsMap, 0, false)).toStream
5050
isOpen <- SignallingRef[F].of(false).toStream
51-
impl = new Impl(payloadSink, ref, isOpen, supervisor)
51+
awaitingSink = isOpen.waitUntil(identity) >> payloadSink(_: Payload)
52+
impl = new Impl(awaitingSink, ref, isOpen, supervisor)
5253
_ <- Stream(()).concurrently {
5354
// Gatekeeping the pull until the channel is actually marked as open
5455
val wait = isOpen.waitUntil(identity)

0 commit comments

Comments
 (0)