colossus.streaming

Pipe

trait Pipe[I, O] extends Sink[I] with Source[O]

A Pipe is a callback-based data transport abstraction meant for handling streams. It provides backpressure feedback for both the write and read ends.

Pipes are primarily a way to easily process incoming/outgoing streams and manage backpressure. A Producer pushes items into a pipe and a consumer pulls them out. Pulling is done through the use of a callback function which the Pipe holds onto until an item is pushed. Each call to pull will only ever pull one item out of the pipe, so generally the consumer enters a loop by calling pull within the callback function.

Backpressure is handled differently for the producer and consumer. In effect, the consumer is the "leader" in terms of backpressure, since the consumer must always ask for more items. For the producer, the return value of push will indicate if backpressure is occurring. When the pipe is "full", push returns a Trigger, which the producer "fills" by supplying a callback function. This function will be called once the backpressure has been alleviated and the pipe can accept more items.

Linear Supertypes
Source[O], Sink[I], Transport, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Pipe
  2. Source
  3. Sink
  4. Transport
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def complete(): Try[Unit]

    Definition Classes
    Sink
  2. abstract def inputState: TransportState

    Definition Classes
    Sink
  3. abstract def outputState: TransportState

    Definition Classes
    Source
  4. abstract def peek: PullResult[O]

    Definition Classes
    Source
  5. abstract def pull(): PullResult[O]

    Definition Classes
    Source
  6. abstract def push(item: I): PushResult

    Definition Classes
    Sink
  7. abstract def pushPeek: PushResult

    Definition Classes
    Sink
  8. abstract def terminate(reason: Throwable): Unit

    Immediately terminate the transport, permenantly putting it into an error state

    Immediately terminate the transport, permenantly putting it into an error state

    Definition Classes
    Transport

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++[U >: O](next: Source[U]): Source[U]

    Definition Classes
    Source
  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def canPullNonEmpty: Boolean

    Definition Classes
    Source
  9. def canPush: Boolean

    Definition Classes
    Sink
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def collected: Callback[Iterator[O]]

    Definition Classes
    Source
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def fold[U](init: U)(cb: (O, U) ⇒ U): Callback[U]

    Definition Classes
    Source
  16. def foldWhile[U](init: U)(cb: (O, U) ⇒ U)(f: (U) ⇒ Boolean): Callback[U]

    Definition Classes
    Source
  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  19. def into[U >: O](sink: Sink[U]): Unit

    Definition Classes
    Source
  20. def into[U >: O](sink: Sink[U], linkClosed: Boolean, linkTerminated: Boolean)(onComplete: (NonOpenTransportState) ⇒ Any): Unit

    Link this source to a sink.

    Link this source to a sink. Items will be pulled from the source and pushed to the sink, respecting backpressure, until either the source is closed or an error occurs. The sink will be closed when this source is closed. If the sink is closed before this source, this source will be terminated. Other terminations are propagated in both directions.

    sink

    The sink to link to this source

    linkClosed

    if true, the linked sink will be closed when this source is closed

    linkTerminated

    if true, the linked sink will be terminated when this source is terminated

    Definition Classes
    Source
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. def mapIn[A](f: (A) ⇒ I): Sink[A]

    Definition Classes
    Sink
  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. def pull(whenReady: (Try[Option[O]]) ⇒ Unit): Unit

    Definition Classes
    Source
  27. def pullCB(): Callback[Option[O]]

    Definition Classes
    Source
  28. def pullUntilNull(fn: (O) ⇒ Boolean): Option[NullPullResult]

    Pull until either the supplied function returns false or there are no more items immediately available to pull, in which case a Some[NullPullResult] is returned indicating why the loop stopped.

    Pull until either the supplied function returns false or there are no more items immediately available to pull, in which case a Some[NullPullResult] is returned indicating why the loop stopped.

    Definition Classes
    Source
  29. def pullWhile(fn: (NEPullResult[O]) ⇒ PullAction): Unit

    Definition Classes
    Source
  30. def reduce[U >: O](reducer: (U, U) ⇒ U): Callback[U]

    Definition Classes
    Source
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  32. def toString(): String

    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def weld[U >: O, T](next: Pipe[U, T]): Pipe[I, T]

Inherited from Source[O]

Inherited from Sink[I]

Inherited from Transport

Inherited from AnyRef

Inherited from Any

Ungrouped