public class AsyncMessageOutputPlus extends AsyncChannelOutputPlus
DataOutputStreamPlus that writes ASYNCHRONOUSLY to a Netty Channel.
Intended as single use, to write one (large) message.
The close() and flush() methods synchronously wait for pending writes, and will propagate any exceptions
encountered in writing them to the wire.
The correctness of this class depends on the ChannelPromise we create against a Channel always being completed,
which appears to be a guarantee provided by Netty so long as the event loop is running.AsyncChannelOutputPlus.FlushExceptionbuffer| Modifier and Type | Method and Description |
|---|---|
void |
close()
Flush any remaining writes, and release any buffers.
|
void |
discard()
Discard any buffered data, and the buffers that contain it.
|
protected void |
doFlush(int count) |
long |
position()
Returns the current position of the underlying target like a file-pointer
or the position withing a buffer.
|
beginFlush, flush, flushed, flushedToNetwork, newDefaultChannel, parkUntilFlushed, releaseSpaceorder, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFretrieveTemporaryBufferclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasPosition, write, writeUnsignedVInt, writeVIntprotected void doFlush(int count)
throws java.io.IOException
doFlush in class AsyncChannelOutputPlusjava.io.IOExceptionpublic void close()
throws java.io.IOException
AsyncChannelOutputPlusAsyncChannelOutputPlus.flushFailed, which will propagate them to the producer thread no later than its
final invocation to AsyncChannelOutputPlus.close() or AsyncChannelOutputPlus.flush() (that must not be followed by any further writes).close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class AsyncChannelOutputPlusjava.io.IOExceptionpublic long position()
DataOutputPlusDataOutputPlus.hasPosition().position in interface DataOutputPlusposition in class AsyncChannelOutputPluspublic void discard()
close() if we terminate exceptionally.discard in class AsyncChannelOutputPlusCopyright © 2009-2020 The Apache Software Foundation