molecule.io

Input

abstract class Input[+A] extends WInput[A] with SInput[A] with RInput[A]

A process-level input channel.

A

the type of the input's messages

Source
Input.scala
Linear Supertypes
RInput[A], SInput[A], WInput[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Input
  2. RInput
  3. SInput
  4. WInput
  5. AnyRef
  6. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Input()

Abstract Value Members

  1. abstract def ++:[B >: A](prefix: Seg[B])(implicit arg0: Message[B]): Input[B]

    Prepend the messages of a given segment in front of this input.

    Prepend the messages of a given segment in front of this input.

    prefix

    The segment to prepend.

    returns

    an input which produces that segment first and then continues with the remaining of the stream.

    Definition Classes
    InputSInput
  2. abstract def +:[B >: A](x: B)(implicit arg0: Message[B]): Input[B]

    Prepend a message in front of this input.

    Prepend a message in front of this input.

    x

    the message to prepend.

    returns

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

    Definition Classes
    InputSInput
  3. abstract def collect[B](pf: PartialFunction[A, B])(implicit arg0: Message[B]): Input[B]

    Builds a new input by applying a partial function to all messages of this input on which the function is defined.

    Builds a new input by applying a partial function to all messages of this input on which the function is defined.

    B

    the message type of the returned collection.

    pf

    the partial function which filters and maps the input.

    returns

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

    Definition Classes
    InputSInput
  4. abstract def compress[B](f: (Seg[A]) ⇒ B)(implicit arg0: Message[B]): Input[B]

    Builds a new input that compresses the content of each segment into a single value.

    Builds a new input that compresses the content of each segment into a single value.

    f

    A function converting segments to a single value.

    returns

    The compressed input.

    Definition Classes
    InputSInput
  5. abstract def connect(ochan: OChan[A]): IO[RIChan[Either[Signal, Signal]]]

    Forward asynchronously the content of this input to an first-class output channel.

    Forward asynchronously the content of this input to an first-class output channel. The output will be closed with the same signal as the input. The output and input are released from this process and the method returns immediately.

    returns

    the signal indicating which channel was closed first

    Definition Classes
    RInput
  6. abstract def connect(output: Output[A]): IO[RIChan[Either[Signal, Signal]]]

    Forward asynchronously the content of this input to an output.

    Forward asynchronously the content of this input to an output. The output will be closed with the same signal as the input. The output and input are released from this process and the method returns immediately.

    output

    the output to connect to this input

    returns

    the signal indicating which channel was closed first

    Definition Classes
    RInput
  7. abstract def debug(label: String, f: (A) ⇒ String = _.toString): Input[A]

    Builds a new debugging input that prints every message received.

    Builds a new debugging input that prints every message received.

    label

    the label to put in front of each debug line.

    f

    A function converting messages to a string.

    returns

    The same input excepted each message will be printed.

    Definition Classes
    InputSInput
  8. abstract def dropWhile(p: (A) ⇒ Boolean): Input[A]

    Skips longest sequence of elements of this input which satisfy given predicate p, and returns an input of the remaining elements.

    Skips longest sequence of elements of this input which satisfy given predicate p, and returns an input of the remaining elements.

    p

    the predicate used to skip elements.

    returns

    an input producing the remaining elements

    Definition Classes
    InputSInput
  9. abstract def extract(t: UThreadContext, k: (A) ⇒ Unit, h: (Signal) ⇒ Unit): Unit

    Attributes
    protected[io]
    Definition Classes
    WInput
  10. abstract def extractSeg(t: UThreadContext, k: (Seg[A]) ⇒ Unit, klast: (Seg[A], Signal) ⇒ Unit): Unit

    Attributes
    protected[io]
    Definition Classes
    SInput
  11. abstract def filter(p: (A) ⇒ Boolean): Input[A]

    Selects all messages of this input which satisfy a predicate.

    Selects all messages of this input which satisfy a predicate.

    p

    the predicate used to test messages.

    returns

    a new input consisting of all messages of this input that satisfy the given predicate p. The order of the messages is preserved.

    Definition Classes
    InputSInput
  12. abstract def flatMap[B](f: (A) ⇒ Seg[B])(implicit arg0: Message[B]): Input[B]

    Builds a new input by applying a function to all messages of this input and concatenating the results.

    Builds a new input by applying a function to all messages of this input and concatenating the results.

    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 collection-valued function f to each message of this input and concatenating the results.

    Definition Classes
    InputSInput
  13. abstract def flatten[B](implicit message: Message[B], asTraversable: (A) ⇒ Traversable[B]): Input[B]

    Converts this input stream of traversable collections into an input stream in which all message collections are concatenated.

    Converts this input stream of traversable collections into an input stream in which all message collections are concatenated.

    B

    the type of the messages of each traversable collection.

    message

    an implicit message definition for the message type of the Traversable.

    asTraversable

    an implicit conversion which asserts that the message type of this input is a Traversable.

    returns

    a new input resulting from concatenating all the Traversable collections.

    Definition Classes
    InputSInput
  14. abstract def fold[B](z: B)(f: (B, A) ⇒ B)(implicit arg0: Message[B]): IO[B]

    Fold left

    Fold left

    Definition Classes
    SInput
  15. abstract def grouped(size: Int): Input[Seg[A]]

    Returns an input which groups messages produced by this input into fixed size blocks.

    Returns an input which groups messages produced by this input into fixed size blocks. The last group may contain less messages the number of messages receives is not a multiple of the group size.

    size

    the size of the groups.

    returns

    an input producing the groups

    Definition Classes
    InputSInput
  16. abstract def interleave[B](right: RInput[B])(implicit arg0: Message[B]): IO[Input[Either[A, B]]]

    Interleave the messages produced asynchronously on this channel with the messages produced on an other channel.

    Interleave the messages produced asynchronously on this channel with the messages produced on an other channel. This builds a new input channel that produces one message of type Either[A, B] for every message produce on this or the other channel, where A is the type of messages produced on this channel and B is the type of messages produced on the other channel. By default, the resulting channel is closed when both input channels are closed.

    right

    the other input channel

    returns

    a new input channel that produces one message of type Either[A, B] for every message produce on this or the other channel

    Definition Classes
    RInput
  17. abstract def map[B](f: (A) ⇒ B)(implicit arg0: Message[B]): Input[B]

    Builds a new input by applying a function to all messages of this input.

    Builds a new input by applying a function to all messages of this input.

    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.

    Definition Classes
    InputSInput
  18. abstract def merge[B >: A](right: RInput[B])(implicit arg0: Message[B]): IO[Input[B]]

    Merge the streams of two channels.

    Merge the streams of two channels. This builds a new input channel that produces messages from this channel and the other channel.

    right

    the other input channel

    returns

    a new input channel that produces messages coming on both input channels

    Definition Classes
    RInput
  19. abstract def parse[C >: A, B](parser: Parser[C, B])(implicit arg0: Message[C], arg1: Message[B]): Input[B]

    Produces an input resulting from applying a repeatedly a parser combinator to this input stream.

    Produces an input resulting from applying a repeatedly a parser combinator to this input stream.

    C

    the type of the messages parsed

    B

    the type of the messages in the resulting input

    parser

    a parser combinator

    returns

    input with parsed results

    Definition Classes
    InputSInput
  20. abstract def poison(): IO[Unit]

    Poison this input with EOS signal

    Poison this input with EOS signal

    Definition Classes
    SInput
  21. abstract def poison(signal: Signal): IO[Unit]

    Poison this input

    Poison this input

    signal

    the poisoning signal

    Definition Classes
    SInput
  22. abstract def read[C >: A, B](parser: Parser[C, B]): IO[B]

    Read a single value using a parser or raise the signal if the input is closed

    Read a single value using a parser or raise the signal if the input is closed

    B

    the type of the pareser element

    parser

    the parser used to parse a single element.

    returns

    the next element of this input.

  23. abstract def release(): IO[IChan[A]]

    Release the first-class input channel from this process.

    Release the first-class input channel from this process.

    Definition Classes
    RInput
  24. abstract def scan[B](z: B)(op: (B, A) ⇒ B)(implicit arg0: Message[B]): Input[B]

    Produces a collection containing cummulative results of applying the operator going first to last message.

    Produces a collection containing cummulative results of applying the operator going first to last message.

    B

    the type of the messages in the resulting input

    z

    the initial value

    op

    the binary operator applied to the intermediate result and the message

    returns

    input with intermediate results

    Definition Classes
    InputSInput
  25. abstract def signal: Option[Signal]

    Returns some signal if the input is closed.

    Returns some signal if the input is closed.

    returns

    Some(signal) if the input contain no more elements, None otherwise.

    Definition Classes
    WInput
  26. abstract def smap[S, B](z: S)(fsm: (S, A) ⇒ (S, B))(implicit arg0: Message[B]): Input[B]

    Produces an input containing cummulative results of applying the operator going first to last message.

    Produces an input containing cummulative results of applying the operator going first to last message.

    B

    the type of the messages in the resulting input

    z

    the initial state

    returns

    input with intermediate results

    Definition Classes
    InputSInput
  27. abstract def span(p: (A) ⇒ Boolean): SInput[A]

    Create an input that produces longest sequence of this input that satisfy predicate p.

    Create an input that produces longest sequence of this input that satisfy predicate p. The current input cannot be manipulated until the last value of the new input has been consumed.

    p

    the predicate to satisfy

    returns

    an input producing only of the first messages that satisfy the predicate.

    Definition Classes
    SInput
  28. abstract def take(size: Int): SInput[A]

    Create an input that produces first n messages of this input.

    Create an input that produces first n messages of this input. The current input cannot be manipulated until the last value of the new input has been consumed.

    returns

    an input producing only of the first n messages of this input, or less than n messages if the input produces less messages.

    Definition Classes
    SInput
  29. abstract def test(thread: UThread): Promise[WInput[A]]

    Test the input stream (see stream.

    Test the input stream (see stream.TestableStream).

    Attributes
    protected[io]
    Definition Classes
    WInput

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 ++:(prefix: Seg[A]): Input[A]

    [use case] Prepend the messages of a given segment in front of this input.

    [use case]

    Prepend the messages of a given segment in front of this input.

    prefix

    The segment to prepend.

    returns

    an input which produces that segment first and then continues with the remaining of the stream.

  5. abstract def +:(x: A): Input[A]

    [use case] Prepend a message in front of this input.

    [use case]

    Prepend a message in front of this input.

    x

    the message to prepend.

    returns

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

  6. abstract def ::(x: A): SInput[A]

    [use case] Prepend a message on this input.

    [use case]

    Prepend a message on this input.

    x

    the message to prepend.

    returns

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

    Definition Classes
    SInput
  7. final def ::[B >: A](x: B)(implicit arg0: Message[B]): Input[B]

    Prepend a message on this input.

    Prepend a message on this input.

    x

    the message to prepend.

    returns

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

    Definition Classes
    SInput
  8. def <%+%>[B](right: WInput[B]): WInput[Either[A, B]]

    Create a selector that reads a value on either input unless one of them is closed.

    Create a selector that reads a value on either input unless one of them is closed. If the one of them is closed an SigInput will be raised in the enclosing scope.

    Definition Classes
    WInput
  9. def <%+>[B](right: WInput[B]): WInput[Either[A, B]]

    Create a selector that reads a value on either input unless the left one is closed.

    Create a selector that reads a value on either input unless the left one is closed. If the left input is closed an SigInput will be raised in the enclosing scope.

    Definition Classes
    WInput
  10. def <+%>[B](right: WInput[B]): WInput[Either[A, B]]

    Create a selector that reads a value on either input unless the right one is closed.

    Create a selector that reads a value on either input unless the right one is closed. If the right input is closed an SigInput will be raised in the enclosing scope.

    Definition Classes
    WInput
  11. def <+>[B](right: WInput[B]): WInput[Either[A, B]]

    Create a selector that reads a value on either input unless they are both closed.

    Create a selector that reads a value on either input unless they are both closed. If both input are closed an SigInput will be raised in the enclosing scope.

    Definition Classes
    WInput
  12. final def ==(arg0: AnyRef): Boolean

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

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

    Definition Classes
    Any
  15. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. abstract def collect[B](pf: PartialFunction[A, B]): Input[B]

    [use case] Builds a new input by applying a partial function to all messages of this input on which the function is defined.

    [use case]

    Builds a new input by applying a partial function to all messages of this input on which the function is defined.

    B

    the message type of the returned collection.

    pf

    the partial function which filters and maps the input.

    returns

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

  17. abstract def debug[B](label: String, f: (A) ⇒ B): Input[B]

    [use case] Builds a new debugging input that prints every message received.

    [use case]

    Builds a new debugging input that prints every message received.

    label

    the label to put in front of each debug line.

    f

    A function converting messages to a string.

    returns

    The same input excepted each message will be printed.

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

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

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  21. abstract def flatMap[B](f: (A) ⇒ Seg[B]): Input[B]

    [use case] Builds a new input by applying a function to all messages of this input and concatenating the results.

    [use case]

    Builds a new input by applying a function to all messages of this input and concatenating the results.

    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 collection-valued function f to each message of this input and concatenating the results.

  22. abstract def flatten[B]: Input[B]

    [use case] Converts this input stream of traversable collections into an input stream in which all message collections are concatenated.

    [use case]

    Converts this input stream of traversable collections into an input stream in which all message collections are concatenated.

    B

    the type of the messages of each traversable collection.

    returns

    a new input resulting from concatenating all the Traversable collections.

  23. def flush(output: Output[A]): IO[Signal]

    Flush the content of this input to an output.

    Flush the content of this input to an output. It returns when this input is empty but does not close the output.

    output

    the output on which to forward this content

    returns

    the signal that closes this input

  24. abstract def foreach(f: (A) ⇒ IO[Unit]): Unit

    [use case] Applies a function f to all elements of this input.

    [use case]

    Applies a function f to all elements of this input.

    f

    the function that is applied for its side-effect to every element. The result of function f is discarded.

    Definition Classes
    WInput
  25. def foreach[U](f: (A) ⇒ IO[U]): IO[Unit]

    Applies a function f to all elements of this input.

    Applies a function f to all elements of this input.

    U

    the type parameter describing the result of function f. This result will always be ignored. Typically U is Unit, but this is not necessary.

    f

    the function that is applied for its side-effect to every element. The result of function f is discarded.

    Definition Classes
    WInput
  26. final def getClass(): java.lang.Class[_]

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

    Definition Classes
    AnyRef → Any
  28. def isClosed: Boolean

    Tests whether this input is closed and returns the signal.

    Tests whether this input is closed and returns the signal.

    returns

    Some(signal) if the input contain no more elements, None otherwise.

    Definition Classes
    WInput
  29. def isEmpty: Boolean

    Tests whether this input is empty (or closed).

    Tests whether this input is empty (or closed).

    returns

    true if the input contain no more elements, false otherwise.

    Definition Classes
    WInput
  30. final def isInstanceOf[T0]: Boolean

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

    [use case] Builds a new input by applying a function to all messages of this input.

    [use case]

    Builds a new input by applying a function to all messages of this input.

    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 read(): IO[A]

    Read a single value or raise the signal if the input is closed

    Read a single value or raise the signal if the input is closed

    returns

    the next element of this input.

    Definition Classes
    WInput
  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  37. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def close(): IO[Unit]

    Close/poison this input with EOS signal

    Close/poison this input with EOS signal

    Definition Classes
    SInput
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0) Use poison instead

  2. def close(signal: Signal): IO[Unit]

    Close/poison this input

    Close/poison this input

    signal

    the poisoning signal

    Definition Classes
    SInput
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0) Use poison instead

  3. def forward(output: Output[A]): IO[Signal]

    Forward the content of this input to an output.

    Forward the content of this input to an output. It returns when this input is empty but does not close the output.

    output

    the output on which to forward this content

    returns

    the signal that closes this input

    Definition Classes
    InputSInput
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0) Use flush instead

Inherited from RInput[A]

Inherited from SInput[A]

Inherited from WInput[A]

Inherited from AnyRef

Inherited from Any