From 15f177f3d4c2f500a04caddae39b74ec445b4b39 Mon Sep 17 00:00:00 2001 From: Daniel Vigovszky Date: Wed, 3 May 2023 09:57:58 +0100 Subject: [PATCH] subscriberToSink fix for calling it from uninterruptible regions (#362) * subscriberToSink fix for calling it from uninterruptible regions * Readme --- README.md | 2 +- .../src/main/scala/zio/interop/reactivestreams/Adapters.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78d1c2d..6be2b5f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This library provides an interoperability layer between ZIO and reactive streams In order to use this library, we need to add the following line in our `build.sbt` file: ```scala -libraryDependencies += "dev.zio" %% "zio-interop-reactive-streams" % "2.0.0" +libraryDependencies += "dev.zio" %% "zio-interop-reactive-streams" % "2.0.1" ``` ## Examples diff --git a/zio-interop-reactivestreams/src/main/scala/zio/interop/reactivestreams/Adapters.scala b/zio-interop-reactivestreams/src/main/scala/zio/interop/reactivestreams/Adapters.scala index 22e1efe..c0859cf 100644 --- a/zio-interop-reactivestreams/src/main/scala/zio/interop/reactivestreams/Adapters.scala +++ b/zio-interop-reactivestreams/src/main/scala/zio/interop/reactivestreams/Adapters.scala @@ -45,7 +45,7 @@ object Adapters { error <- Promise.make[E, Nothing] subscription = new DemandTrackingSubscription(sub) _ <- ZIO.succeed(sub.onSubscribe(subscription)) - fiber <- error.await.catchAll(t => ZIO.succeed(sub.onError(t))).forkScoped + fiber <- error.await.interruptible.catchAll(t => ZIO.succeed(sub.onError(t))).forkScoped } yield (error.fail(_) *> fiber.join, demandUnfoldSink(sub, subscription)) }