molecule.stream

OChan

abstract class OChan[-A] extends AnyRef

A stream output channel.

A

the type of the output's messages

Source
OChan.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. OChan
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OChan()

Abstract Value Members

  1. abstract def add[B](t: (OChan[A]) ⇒ OChan[B])(implicit arg0: Message[B]): OChan[B]

    Add a stream transformer to this channel.

    Add a stream transformer to this channel.

    t

    the transformer

    returns

    the transformed channel

  2. abstract def close(signal: Signal): Unit

    Close the channel

  3. abstract def write(t: UThread, seg: Seg[A], sigOpt: Option[Signal], k: (OChan[A]) ⇒ Unit): Unit

    Write a segment on this channel.

    Write a segment on this channel.

    t

    the user-level thread

    k

    the continuation invoked once the message has been written

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. abstract def :+:(seg: Seg[A]): OChan[A]

    [use case] Adds a segment in front of this output.

    [use case]

    Adds a segment in front of this output.

    seg

    the segment to prepend.

    returns

    an output which produces seg as first segment and which continues with the remaining of the stream.

  5. def :+:[B <: A](seg: Seg[B])(implicit arg0: Message[B]): OChan[B]

    Adds a segment in front of this output.

    Adds a segment in front of this output.

    seg

    the segment to prepend.

    returns

    an output which produces seg as first segment and which continues with the remaining of the stream.

  6. abstract def :+:(x: A): OChan[A]

    [use case] Adds a message in front of this output.

    [use case]

    Adds a message in front of this output.

    x

    the message to prepend.

    returns

    an output which produces x as first message and which continues with the remaining of the stream.

  7. def :+:[B <: A](x: B)(implicit arg0: Message[B]): OChan[B]

    Adds a message in front of this output.

    Adds a message in front of this output.

    x

    the message to prepend.

    returns

    an output which produces x as first message and which continues with the remaining of the stream.

  8. final def ==(arg0: AnyRef): Boolean

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

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

    Definition Classes
    Any
  11. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def close(t: UThread, a: A, signal: Signal): Unit

    Write last value

    Write last value

    a

    the last value

  13. def close(t: UThread, seg: Seg[A], signal: Signal): Unit

    Write the last segment

    Write the last segment

    Note that this must flush any buffered channel (@see BufferedOChan).

    seg

    the last segment

  14. abstract def collect[B](pf: PartialFunction[B, A]): OChan[B]

    [use case] Builds a new output that applies a partial function to all messages on which the function is defined and filter out the others.

    [use case]

    Builds a new output that applies a partial function to all messages on which the function is defined and filter out the others.

    B

    the message type of the returned output channel.

    pf

    the partial function which filters and maps the stream elements.

    returns

    a new output resulting from applying the partial function pf to each message on which it is defined. The order of the messages is preserved.

  15. def collect[B](f: PartialFunction[B, A])(implicit arg0: Message[B]): OChan[B]

    Builds a new output that applies a partial function to all messages on which the function is defined and filter out the others.

    Builds a new output that applies a partial function to all messages on which the function is defined and filter out the others.

    B

    the message type of the returned output channel.

    returns

    a new output resulting from applying the partial function pf to each message on which it is defined. The order of the messages is preserved.

  16. abstract def compress[B](f: (Seg[B]) ⇒ A): OChan[B]

    [use case] Builds a new output that applies a function to every segment written to it.

    [use case]

    Builds a new output that applies a function to every segment written to it.

    B

    the message type of the returned output.

    f

    the function to apply to each segment and returning a single message.

    returns

    a new output resulting from applying the given collection-valued function f to each segment written to it.

  17. def compress[B](f: (Seg[B]) ⇒ A)(implicit arg0: Message[B]): OChan[B]

    Builds a new output that applies a function to every segment written to it.

    Builds a new output that applies a function to every segment written to it.

    B

    the message type of the returned output.

    f

    the function to apply to each segment and returning a single message.

    returns

    a new output resulting from applying the given collection-valued function f to each segment written to it.

  18. def debug[B <: A](label: String, f: (B) ⇒ String)(implicit arg0: Message[B]): OChan[B]

    Builds a new debugging output that prints every message received.

    Builds a new debugging output that prints every message received.

    label

    the label to put in front of each debug line.

    f

    A function converting messages to a string (defaults to _.toString).

    returns

    The same output excepted each message will be printed.

  19. abstract def encode[B](f: (B) ⇒ Seg[A]): OChan[B]

    [use case] Builds a new output that applies a function to every messages written to it and concatenates the resulting segments.

    [use case]

    Builds a new output that applies a function to every messages written to it and concatenates the resulting segments.

    B

    the message type of the returned output.

    f

    the function to apply to each message and returning a segment.

    returns

    a new output resulting from applying the given collection-valued function f to each message written and concatenating the results.

  20. def encode[B](f: (B) ⇒ Seg[A])(implicit arg0: Message[B]): OChan[B]

    Builds a new output that applies a function to every messages written to it and concatenates the resulting segments.

    Builds a new output that applies a function to every messages written to it and concatenates the resulting segments.

    B

    the message type of the returned output.

    f

    the function to apply to each message and returning a segment.

    returns

    a new output resulting from applying the given collection-valued function f to each message written and concatenating the results.

  21. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. abstract def flatMap[B](f: (B) ⇒ Traversable[A]): OChan[B]

    [use case] Builds a new output that applies a function to all messages written to it and concatenates the results.

    [use case]

    Builds a new output that applies a function to all messages written to it and concatenates the results.

    B

    the message type of the returned output.

    f

    the function to apply to each message.

    returns

    a new output resulting from applying the given collection-valued function f to each message written and concatenating the results.

  25. def flatMap[B](f: (B) ⇒ Seg[A])(implicit arg0: Message[B]): OChan[B]

    Builds a new output that applies a function to all messages written to it and concatenates the results.

    Builds a new output that applies a function to all messages written to it and concatenates the results.

    B

    the message type of the returned output.

    f

    the function to apply to each message.

    returns

    a new output resulting from applying the given collection-valued function f to each message written and concatenating the results.

  26. def flush[B <: A](ichan: IChan[B]): Process[(IChan[B], OChan[B])]

    Flush the content of an input to this output.

    Flush the content of an input to this output. It stops as soon as one of the two channel is poisoned and it does not propagate the poison signal.

    returns

    A stream that returns the channels after the flush operation. If the stream completed successfully, then the input channel is closed, otherwise the output channel is poisoned.

  27. final def getClass(): java.lang.Class[_]

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

    Definition Classes
    AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. abstract def map[B](f: (B) ⇒ A): OChan[B]

    [use case] Builds a new output by applying a function to all the messages wrote to it.

    [use case]

    Builds a new output by applying a function to all the messages wrote to it.

    B

    the message type of the returned input.

    f

    the function to apply to each message.

    returns

    a new input resulting from applying the given function f to each message of this input.

  31. def map[B](f: (B) ⇒ A)(implicit arg0: Message[B]): OChan[B]

    Builds a new output by applying a function to all the messages wrote to it.

    Builds a new output by applying a function to all the messages wrote to it.

    B

    the message type of the returned input.

    f

    the function to apply to each message.

    returns

    a new input resulting from applying the given function f to each message of this input.

  32. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  35. def parse[B](parse: Parser[B, A])(implicit arg0: Message[B]): OChan[B]

    Produces an output resulting from applying a repeatedly a parser combinator to its messages.

    Produces an output resulting from applying a repeatedly a parser combinator to its messages.

    B

    the type of the messages of the resulting output

    returns

    output which parses its messages

  36. def smap[S, B](z: S)(fsm: (S, B) ⇒ (S, A))(implicit arg0: Message[B]): OChan[B]

    Builds an output producing cummulative results of applying the operator going from first to last message written.

    Builds an output producing cummulative results of applying the operator going from first to last message written.

    B

    the type of the messages accepted by the resulting output

    z

    the initial state

    returns

    output producing intermediate results

  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  38. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any