Skip to content

Commit 2f62494

Browse files
committed
Handle RejectedExecutionException inside StreamPublisher
1 parent a9e0747 commit 2f62494

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/shared/src/main/scala/fs2/interop/flow/StreamPublisher.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import cats.effect.unsafe.IORuntime
3030

3131
import java.util.Objects.requireNonNull
3232
import java.util.concurrent.Flow.{Publisher, Subscriber, Subscription}
33+
import java.util.concurrent.RejectedExecutionException
3334
import scala.util.control.NoStackTrace
3435

3536
/** Implementation of a [[Publisher]].
@@ -58,7 +59,7 @@ private[flow] sealed abstract class StreamPublisher[F[_], A] private (
5859
StreamSubscription.subscribe(stream, subscriber)
5960
)
6061
catch {
61-
case _: IllegalStateException =>
62+
case _: IllegalStateException | _: RejectedExecutionException =>
6263
subscriber.onSubscribe(new Subscription {
6364
override def cancel(): Unit = ()
6465
override def request(x$1: Long): Unit = ()

0 commit comments

Comments
 (0)