Skip to content

Commit

Permalink
use fs2 flow interop instead of reactivestreams
Browse files Browse the repository at this point in the history
  • Loading branch information
domaspoliakas committed Jan 24, 2024
1 parent eaeefa4 commit 96e378d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/main/scala/mongo4cats/helpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ package mongo4cats

import cats.effect.Async
import fs2.Stream
import fs2.interop.reactivestreams
import fs2.interop.flow
import org.reactivestreams.Publisher
import org.reactivestreams.FlowAdapters

object helpers {

Expand All @@ -36,9 +37,9 @@ object helpers {
boundedStream(1).compile.drain

def stream[F[_]: Async]: Stream[F, T] =
reactivestreams.fromPublisher(publisher, DefaultStreamChunkSize)
flow.fromPublisher(FlowAdapters.toFlowPublisher(publisher), DefaultStreamChunkSize)

def boundedStream[F[_]: Async](chunkSize: Int): Stream[F, T] =
reactivestreams.fromPublisher(publisher, chunkSize)
flow.fromPublisher(FlowAdapters.toFlowPublisher(publisher), chunkSize)
}
}

0 comments on commit 96e378d

Please sign in to comment.