Packages

  • package root
    Definition Classes
    root
  • package fs2
    Definition Classes
    root
  • package interop
    Definition Classes
    fs2
  • package reactivestreams

    Implementation of the reactivestreams protocol for fs2

    Implementation of the reactivestreams protocol for fs2

    Definition Classes
    interop
    Deprecated

    The next major version of fs2 will drop these converters. Rather, users will be encouraged to use the new fs2.interop.flow package, which provides support for the java.util.concurrent.Flow types; that superseded the reactive-streams library. In case you need to interop with a library that only provides reactive-streams types, you may use org.reactivestreams.FlowAdapters

    Example:
    1. scala> import fs2._
      scala> import fs2.interop.reactivestreams._
      scala> import cats.effect.{IO, Resource}, cats.effect.unsafe.implicits.global
      scala>
      scala> val upstream: Stream[IO, Int] = Stream(1, 2, 3).covary[IO]
      scala> val publisher: Resource[IO, StreamUnicastPublisher[IO, Int]] = upstream.toUnicastPublisher
      scala> val downstream: Stream[IO, Int] = Stream.resource(publisher).flatMap(_.toStreamBuffered[IO](bufferSize = 16))
      scala>
      scala> downstream.compile.toVector.unsafeRunSync()
      res0: Vector[Int] = Vector(1, 2, 3)
    See also

    http://www.reactive-streams.org/

  • PublisherOps
  • StreamOps
  • StreamSubscriber
  • StreamUnicastPublisher

implicit final class PublisherOps[A] extends AnyVal

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PublisherOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new PublisherOps(publisher: Publisher[A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  7. val publisher: Publisher[A]
  8. def toStreamBuffered[F[_]](bufferSize: Int)(implicit arg0: Async[F]): Stream[F, A]

    Creates a lazy stream from an org.reactivestreams.Publisher

    Creates a lazy stream from an org.reactivestreams.Publisher

    bufferSize

    setup the number of elements asked each time from the org.reactivestreams.Publisher. A high number can be useful if the publisher is triggering from IO, like requesting elements from a database. The publisher can use this bufferSize to query elements in batch. A high number will also lead to more elements in memory.

  9. def toString(): String
    Definition Classes
    Any

Deprecated Value Members

  1. def toStream[F[_]](implicit arg0: Async[F]): Stream[F, A]

    Creates a lazy stream from an org.reactivestreams.Publisher

    Creates a lazy stream from an org.reactivestreams.Publisher

    Annotations
    @deprecated
    Deprecated

    (Since version 3.1.4) Use toStreamBuffered method instead. Use a buffer size of 1 to keep the same behavior.

Inherited from AnyVal

Inherited from Any

Ungrouped