Packages

  • package root
    Definition Classes
    root
  • package fs2
    Definition Classes
    root
  • package interop
    Definition Classes
    fs2
  • package flow

    Implementation of the reactive-streams protocol for fs2; based on Java Flow.

    Implementation of the reactive-streams protocol for fs2; based on Java Flow.

    Definition Classes
    interop
    Deprecated

    All syntax has been moved directly onto Stream.

    Example:
    1. scala> import cats.effect.IO
      scala> import fs2.Stream
      scala> import java.util.concurrent.Flow.Publisher
      scala>
      scala> val upstream: Stream[IO, Int] = Stream(1, 2, 3).covary[IO]
      scala> val publisher: Stream[IO, Publisher[Int]] = upstream.toPublisher
      scala> val downstream: Stream[IO, Int] = publisher.flatMap { publisher =>
           |   Stream.fromPublisher[IO](publisher, chunkSize = 16)
           | }
      scala>
      scala> import cats.effect.unsafe.implicits.global
      scala> downstream.compile.toVector.unsafeRunSync()
      res0: Vector[Int] = Vector(1, 2, 3)
    See also

    java.util.concurrent.Flow

  • 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/

  • package scodec
    Definition Classes
    interop
  • CodecError
  • StreamDecoder
  • StreamEncoder

package scodec

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class CodecError(err: Err) extends Exception with Product with Serializable

    Lifts an scodec.Err in to an exception.

  2. final class StreamDecoder[+A] extends AnyRef

    Supports binary decoding of a stream that emits elements as they are decoded.

    Supports binary decoding of a stream that emits elements as they are decoded.

    The main purpose of using a StreamDecoder over a scodec.Decoder is mixing decoding with processing. For example, scodec.codecs.vector(decoderA): Decoder[Vector[A]] could be used to decode a bit stream but the decoded Vector[A] would not be emitted until the end of the bit stream. With StreamDecoder.many(decoderA): StreamDecoder[A], each decoded A value is emitted as soon as it is decoded.

    The StreamDecoder companion has various constructors -- most importantly, once and many, that allow a Decoder[A] to be lifted to a StreamDecoder[A].

    Given a StreamDecoder[A], a bit stream can be decoded via the decode method or by calling a variant of toPipe.

  3. final class StreamEncoder[A] extends AnyRef

    A streaming encoding process, represented as a Stream[Pure, A] => Pull[Pure, BitVector, Option[(Stream[Pure, A], StreamEncoder[A])]].

Value Members

  1. object StreamDecoder
  2. object StreamEncoder

Ungrouped