object Reader

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Reader
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def concat[A](readers: Seq[Reader[A]]): Reader[A]

    Convenient abstraction to read from a collection of Readers as if it were a single Reader.

    Convenient abstraction to read from a collection of Readers as if it were a single Reader.

    readers

    A collection of Reader[A]

  2. def concat[A](readers: AsyncStream[Reader[A]]): Reader[A]

    Convenient abstraction to read from a stream (AsyncStream) of Readers as if it were a single Reader.

    Convenient abstraction to read from a stream (AsyncStream) of Readers as if it were a single Reader.

    readers

    An AsyncStream holds a stream of Reader[A]

  3. def empty[A]: Reader[A]
  4. def exception[A](e: Throwable): Reader[A]

    Construct a Reader from an exception e

  5. def flatten[A](readers: Reader[Reader[A]]): Reader[A]

    Convenient abstraction to read from a stream (Reader) of Readers as if it were a single Reader.

    Convenient abstraction to read from a stream (Reader) of Readers as if it were a single Reader.

    readers

    A Reader holds a stream of Reader[A]

    Note

    All operations of the new Reader will be in sync with the outermost Reader. Discarding one Reader will discard the other Reader. When one Reader's onClose resolves, the other Reader's onClose will be resolved immediately with the same value. The subsequent readers are unmanaged, the caller is responsible for discarding those when abandoned.

  6. def fromAsyncStream[A](as: AsyncStream[A]): Reader[A]

    Allow com.twitter.concurrent.AsyncStream to be consumed as a Reader

  7. def fromBuf(buf: Buf, chunkSize: Int): Reader[Buf]

    Create a new Reader from a given Buf.

    Create a new Reader from a given Buf. The output of a returned reader is chunked by at most chunkSize (bytes).

    Note

    The n (number of bytes to read) argument on the returned reader's read is ignored.

  8. def fromBuf(buf: Buf): Reader[Buf]

    Create a new Reader from a given Buf.

    Create a new Reader from a given Buf. The output of a returned reader is chunked by a least chunkSize (bytes).

  9. def fromCollection[A](list: Collection[A]): Reader[A]

    Java-Friendly version of fromSeq Create a new Reader from a given Java List

  10. def fromFile(f: File, chunkSize: Int): Reader[Buf]

    Create a new Reader from a given File.

    Create a new Reader from a given File. The output of a returned reader is chunked by at most chunkSize (bytes).

    The resources held by the returned Reader are released on reading of EOF and Reader.discard.

    See also

    Readers.fromFile for a Java API

  11. def fromFile(f: File): Reader[Buf]

    Create a new Reader from a given File.

    Create a new Reader from a given File. The output of a returned reader is chunked by at most chunkSize (bytes).

    The resources held by the returned Reader are released on reading of EOF and Reader.discard.

    See also

    Readers.fromFile for a Java API

  12. def fromFuture[A](fa: Future[A]): Reader[A]

    Construct a Reader from a Future

    Construct a Reader from a Future

    Note

    Multiple outstanding reads are not allowed on this reader

  13. def fromIterator[A](it: Iterator[A]): Reader[A]

    Create a new Reader from a given Iterator.

    Create a new Reader from a given Iterator.

    The resources held by the returned Reader are released on reading of EOF and Reader.discard.

    Note

    It is not recommended to call it.next() after creating a Reader from it. Doing so will affect the behavior of Reader.read() because it will skip the value returned from it.next.

  14. def fromSeq[A](seq: Seq[A]): Reader[A]

    Create a new Reader from a given Seq.

    Create a new Reader from a given Seq.

    The resources held by the returned Reader are released on reading of EOF and Reader.discard.

    Note

    Multiple outstanding reads are not allowed on this reader.

  15. def fromStream(s: InputStream, chunkSize: Int): Reader[Buf]

    Create a new Reader from a given InputStream.

    Create a new Reader from a given InputStream. The output of a returned reader is chunked by at most chunkSize (bytes).

    The resources held by the returned Reader are released on reading of EOF and Reader.discard.

    See also

    Readers.fromStream for a Java API

  16. def fromStream(s: InputStream): Reader[Buf]

    Create a new Reader from a given InputStream.

    Create a new Reader from a given InputStream. The output of a returned reader is chunked by at most chunkSize (bytes).

    The resources held by the returned Reader are released on reading of EOF and Reader.discard.

  17. def readAllItems[A](r: Reader[A]): Future[Seq[A]]

    Read all items from the Reader r.

    Read all items from the Reader r.

    r

    The reader to read from

    returns

    A Sequence of items.

  18. def readAllItemsInterruptible[A](r: Reader[A]): Future[Seq[A]]

    Read all items from the Reader r, interrupting the returned future will discard the reader.

    Read all items from the Reader r, interrupting the returned future will discard the reader.

    r

    The reader to read from

    returns

    A Sequence of items.

  19. def toAsyncStream[A](r: Reader[A]): AsyncStream[A]

    Transformation (or lift) from Reader into AsyncStream.

  20. def value[A](a: A): Reader[A]

    Construct a Reader from a value a

    Construct a Reader from a value a

    Note

    Multiple outstanding reads are not allowed on this reader