All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ongo.reactivemongo-pekkostream_2.12.1.1.0-RC15.source-code.package.scala Maven / Gradle / Ivy

The newest version!
package reactivemongo

import scala.concurrent.Future

import reactivemongo.api.{ Cursor, CursorFlattener, CursorProducer }

package object pekkostream {

  type PekkoCursorProducer[T] = CursorProducer[T] {
    type ProducedCursor = PekkoStreamCursor.WithOps[T]
  }

  /** Provides Pekko Streams instances for CursorProducer typeclass. */
  implicit def cursorProducer[T]: PekkoCursorProducer[T] =
    new CursorProducer[T] {
      type ProducedCursor = PekkoStreamCursor.WithOps[T]

      // Returns a cursor with Pekko Streams operations.
      def produce(c: Cursor.WithOps[T]): ProducedCursor =
        new PekkoStreamCursorImpl[T](c)
    }

  /** Provides flattener for Pekko Streams cursor. */
  implicit object cursorFlattener extends CursorFlattener[PekkoStreamCursor] {

    def flatten[T](future: Future[PekkoStreamCursor[T]]): PekkoStreamCursor[T] =
      new pekkostreamFlattenedCursor(future)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy