Open pragmaxim opened 1 year ago
Not tested, bu shouldn't this work?
def processorToZPipeline[In, Out](processor: Processor[In, Out]): ZPipeline[Scope, Throwable, In, Out] =
ZPipeline.unwrap(
for {
signalErrorSink <- processor.toZIOSink
(signalError, sink) = signalErrorSink
stream = processor.toZIOStream()
sinkPipe = ZPipeline.fromSink(sink)
sourcePipe = ZPipeline.fromChannel(stream.channel)
} yield sinkPipe >>> sourcePipe
)
Well, it doesn't.
@runtologist are you looking at this one? If not -- I just hit a usecase for this at work, so I can take care of it.
org.reactivestreams.Processor
is an equivalent ofZPipeline
orakka.stream.scaladsl.Flow
and when integrating between different reactive "implementation", it is possible to create it usingorg.reactivestreams.FlowAdapters.toFlowProcessor
... Akka-stream hasflow.toProcessor
method but I can't find a way how to turnZPipeline
into aProcessor
.Any idea?