PipeOps

fs2.Stream.PipeOps
final implicit class PipeOps[F[_], I, O](self: (F, I) => O) extends AnyVal

Provides operations on effectful pipes for syntactic convenience.

Attributes

Source
Stream.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def attachL[I1, O2](p: (F, O, I1) => O2): (F, I, I1) => O2

Transforms the left input of the given Pipe2 using a Pipe.

Transforms the left input of the given Pipe2 using a Pipe.

Attributes

Source
Stream.scala
def attachR[I0, O2](p: (F, I0, O) => O2): (F, I0, I) => O2

Transforms the right input of the given Pipe2 using a Pipe.

Transforms the right input of the given Pipe2 using a Pipe.

Attributes

Source
Stream.scala
def toProcessor(chunkSize: Int)(implicit F: Async[F]): Resource[F, Processor[I, O]]

Creates a flow Processor from this Pipe.

Creates a flow Processor from this Pipe.

You are required to manually subscribe this Processor to an upstream Publisher, and have at least one downstream Subscriber subscribe to the Consumer.

Closing the Resource means not accepting new subscriptions, but waiting for all active ones to finish consuming. Canceling the Resource.use means gracefully shutting down all active subscriptions. Thus, no more elements will be published.

Value parameters

chunkSize

setup the number of elements asked each time from the upstream Publisher. A high number may be useful if the publisher is triggering from IO, like requesting elements from a database. A high number will also lead to more elements in memory.

Attributes

Source
Stream.scala