typelevel / fs2

Compositional, streaming I/O library for Scala
https://fs2.io
Other
2.37k stars 602 forks source link

Reactive-streams interop is uncancelable #3260

Open Jasper-M opened 1 year ago

Jasper-M commented 1 year ago

The implementation still uses an uncancelable async_ call which will hang on CE 3.5: https://github.com/typelevel/fs2/blob/9c523441c8f1770faafb36e01c893218162cdb72/reactive-streams/src/main/scala/fs2/interop/reactivestreams/StreamSubscriber.scala#L223

The java flow interop is fixed, but the fix hasn't been released yet. Since the reactive-streams interop seems to be deprecated in favor of the flow interop, perhaps just releasing the fixed flow interop is sufficient? Though I noticed that the compiler doesn't seem to actually show any deprecation warnings.

armanbilge commented 1 year ago

Since the reactive-streams interop seems to be deprecated in favor of the flow interop,

Well, yes and no. reactive-streams is the only option available on JDK8, flow was introduced in JDK9.

Though I noticed that the compiler doesn't seem to actually show any deprecation warnings.

We implemented as a "soft" deprecation that only appears in scaladocs. This is because hard-deprecating would leave JDK8 users out in the cold.

Jasper-M commented 1 year ago

Ah ok that makes sense.

armanbilge commented 9 months ago

Just to give a more concrete action for anyone hitting this issue: if you are on JDK 9+, please switch to the FS2 Flow interop and if necessary use the official Reactive Streams FlowAdapters.

There is no reason to use the FS2 Reactive Streams interop anymore unless you are stuck on JDK 8.


Edit: for the record, a PR to fix FS2 Reactive Streams interop is welcome, if anyone feels so inclined :)