Close the resource with the given deadline.
Close the resource with the given deadline. This deadline is advisory, giving the callee some leeway, for example to drain clients or finish up other tasks.
Discard this reader: its output is no longer required.
Discard this reader: its output is no longer required.
Indicate that the producer of the bytestream has failed.
Indicate that the producer of the bytestream has failed. No further writes are allowed.
Asynchronously read at most n
bytes from the byte stream.
Asynchronously read at most n
bytes from the byte stream. The
returned future represents the results of the read request. If
the read fails, the Reader is considered failed -- future reads
will also fail.
A result of None indicates EOF.
Write a chunk.
Write a chunk. The returned future is completed when the chunk has been fully read by the sink.
Only one outstanding write
is permitted, thus
backpressure is asserted.
Close the resource with the given timeout.
Close the resource with the given timeout. This timeout is advisory, giving the callee some leeway, for example to drain clients or finish up other tasks.
Close the resource.
Close the resource. The returned Future is completed when the resource has been fully relinquished.
A Reader that is linked with a Writer and
close
-ing is synchronous.Just as with readers and writers, only one outstanding
read
orwrite
is permitted.For a proper
close
, it should only be done when no writes are outstanding:val rw = Reader.writable() ... rw.write(buf).before(rw.close())
If a producer is interested in knowing when all writes have been read and the reader has seen the EOF, it can wait until the future returned by
close()
is satisfied: