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
    Example:
    1. scala> import fs2._
      scala> import fs2.interop.reactivestreams._
      scala> import cats.effect.{ContextShift, IO}
      scala> import scala.concurrent.ExecutionContext
      scala>
      scala> implicit val contextShift: ContextShift[IO] = IO.contextShift(ExecutionContext.global)
      scala>
      scala> val upstream: Stream[IO, Int] = Stream(1, 2, 3).covary[IO]
      scala> val publisher: StreamUnicastPublisher[IO, Int] = upstream.toUnicastPublisher
      scala> val downstream: Stream[IO, Int] = publisher.toStream[IO]
      scala>
      scala> downstream.compile.toVector.unsafeRunSync()
      res0: Vector[Int] = Vector(1, 2, 3)
    See also

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

  • PublisherOps
  • StreamOps
  • StreamSubscriber
  • StreamUnicastPublisher
p

fs2.interop

reactivestreams

package reactivestreams

Implementation of the reactivestreams protocol for fs2

Source
package.scala
Example:
  1. scala> import fs2._
    scala> import fs2.interop.reactivestreams._
    scala> import cats.effect.{ContextShift, IO}
    scala> import scala.concurrent.ExecutionContext
    scala>
    scala> implicit val contextShift: ContextShift[IO] = IO.contextShift(ExecutionContext.global)
    scala>
    scala> val upstream: Stream[IO, Int] = Stream(1, 2, 3).covary[IO]
    scala> val publisher: StreamUnicastPublisher[IO, Int] = upstream.toUnicastPublisher
    scala> val downstream: Stream[IO, Int] = publisher.toStream[IO]
    scala>
    scala> downstream.compile.toVector.unsafeRunSync()
    res0: Vector[Int] = Vector(1, 2, 3)
See also

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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. reactivestreams
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. implicit final class PublisherOps[A] extends AnyVal
  2. implicit final class StreamOps[F[_], A] extends AnyRef
  3. final class StreamSubscriber[F[_], A] extends Subscriber[A]

    Implementation of a org.reactivestreams.Subscriber.

    Implementation of a org.reactivestreams.Subscriber.

    This is used to obtain a fs2.Stream from an upstream reactivestreams system.

    See also

    https://github.com/reactive-streams/reactive-streams-jvm#2-subscriber-code

  4. final class StreamUnicastPublisher[F[_], A] extends Publisher[A]

    Implementation of a org.reactivestreams.Publisher

    Implementation of a org.reactivestreams.Publisher

    This is used to publish elements from a fs2.Stream to a downstream reactivestreams system.

    See also

    https://github.com/reactive-streams/reactive-streams-jvm#1-publisher-code

Value Members

  1. def fromPublisher[F[_], A](p: Publisher[A])(implicit arg0: ConcurrentEffect[F]): Stream[F, A]

    Creates a lazy stream from an org.reactivestreams.Publisher.

    Creates a lazy stream from an org.reactivestreams.Publisher.

    The publisher only receives a subscriber when the stream is run.

  2. object StreamSubscriber
  3. object StreamUnicastPublisher

Inherited from AnyRef

Inherited from Any

Ungrouped