Discard this stream as its output is no longer required.
Discard this stream as its output is no longer required. This could be used to signal the producer of this stream similarly how com.twitter.util.Future.raise used to propagate interrupts across future chains.
Although unnecessary, it's always safe to discard a fully-consumed stream.
A com.twitter.util.Future that resolves once this reader is closed upon reading of end-of-stream.
A com.twitter.util.Future that resolves once this reader is closed upon reading of end-of-stream.
If the result is a failed future, this indicates that it was not closed either by reading until the end of the stream nor by discarding. This is useful for any extra resource cleanup that you must do once the stream is no longer being used.
Asynchronously read the next element of this stream.
Asynchronously read the next element of this stream. Returned com.twitter.util.Future
will resolve into Some(e)
when the element is available or into None
when stream
is exhausted.
Stream failures are terminal such that all subsequent reads will resolve in failed com.twitter.util.Futures.
Construct a new Reader by applying f
to every item read from this Reader
Construct a new Reader by applying f
to every item read from this Reader
the function constructs a new Reader[B] from the value of this Reader.read
All operations of the new Reader will be in sync with self 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.
Converts a Reader[Reader[B]]
into a Reader[B]
Converts a Reader[Reader[B]]
into a Reader[B]
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.
Construct a new Reader by applying f
to every item read from this Reader
Construct a new Reader by applying f
to every item read from this Reader
the function transforms data of type A to B
All operations of the new Reader will be in sync with self 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.
Abstract
Reader
class for Java compatibility.