public class HTTP2Flusher extends IteratingCallback implements Dumpable
Modifier and Type | Class and Description |
---|---|
static class |
HTTP2Flusher.Entry |
private class |
HTTP2Flusher.WindowEntry |
IteratingCallback.Action
Callback.Completable, Callback.Completing, Callback.Nested
Invocable.InvocationType
Modifier and Type | Field and Description |
---|---|
private static java.nio.ByteBuffer[] |
EMPTY_BYTE_BUFFERS |
private java.util.Deque<HTTP2Flusher.Entry> |
entries |
private ByteBufferPool.Lease |
lease |
private static Logger |
LOG |
private java.util.Queue<HTTP2Flusher.Entry> |
pendingEntries |
private java.util.Set<HTTP2Flusher.Entry> |
processedEntries |
private HTTP2Session |
session |
private HTTP2Flusher.Entry |
stalledEntry |
private java.lang.Throwable |
terminated |
private java.util.Queue<HTTP2Flusher.WindowEntry> |
windows |
__nonBlocking
Constructor and Description |
---|
HTTP2Flusher(HTTP2Session session) |
Modifier and Type | Method and Description |
---|---|
boolean |
append(HTTP2Flusher.Entry entry) |
private void |
closed(HTTP2Flusher.Entry entry,
java.lang.Throwable failure) |
java.lang.String |
dump() |
void |
dump(java.lang.Appendable out,
java.lang.String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.
|
private void |
finish() |
int |
getFrameQueueSize() |
private int |
getWindowQueueSize() |
protected void |
onCompleteFailure(java.lang.Throwable x)
Invoked when the overall task has completed with a failure.
|
protected void |
onCompleteSuccess()
Invoked when the overall task has completed successfully.
|
(package private) void |
onFlushed(long bytes) |
boolean |
prepend(HTTP2Flusher.Entry entry) |
protected IteratingCallback.Action |
process()
Method called by
IteratingCallback.iterate() to process the sub task. |
void |
succeeded()
Invoked when the sub task succeeds.
|
(package private) void |
terminate(java.lang.Throwable cause) |
java.lang.String |
toString() |
void |
window(IStream stream,
WindowUpdateFrame frame) |
close, failed, isClosed, isFailed, isSucceeded, iterate, reset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dump, dumpObject, dumpObjects, dumpSelf
getInvocationType, getInvocationType, invokeNonBlocking, isNonBlockingInvocation
private static final Logger LOG
private static final java.nio.ByteBuffer[] EMPTY_BYTE_BUFFERS
private final java.util.Queue<HTTP2Flusher.WindowEntry> windows
private final java.util.Deque<HTTP2Flusher.Entry> entries
private final java.util.Queue<HTTP2Flusher.Entry> pendingEntries
private final java.util.Set<HTTP2Flusher.Entry> processedEntries
private final HTTP2Session session
private final ByteBufferPool.Lease lease
private java.lang.Throwable terminated
private HTTP2Flusher.Entry stalledEntry
public HTTP2Flusher(HTTP2Session session)
public void window(IStream stream, WindowUpdateFrame frame)
public boolean prepend(HTTP2Flusher.Entry entry)
public boolean append(HTTP2Flusher.Entry entry)
private int getWindowQueueSize()
public int getFrameQueueSize()
protected IteratingCallback.Action process() throws java.lang.Throwable
IteratingCallback
IteratingCallback.iterate()
to process the sub task.
Implementations must start the asynchronous execution of the sub task (if any) and return an appropriate action:
IteratingCallback.Action.IDLE
when no sub tasks are available for execution
but the overall job is not completed yetIteratingCallback.Action.SCHEDULED
when the sub task asynchronous execution
has been startedIteratingCallback.Action.SUCCEEDED
when the overall job is completedprocess
in class IteratingCallback
java.lang.Throwable
- if the sub task processing throwsvoid onFlushed(long bytes) throws java.io.IOException
java.io.IOException
public void succeeded()
IteratingCallback
super.succeeded()
.succeeded
in interface Callback
succeeded
in class IteratingCallback
Callback.failed(Throwable)
private void finish()
protected void onCompleteSuccess()
IteratingCallback
onCompleteSuccess
in class IteratingCallback
IteratingCallback.onCompleteFailure(Throwable)
protected void onCompleteFailure(java.lang.Throwable x)
IteratingCallback
onCompleteFailure
in class IteratingCallback
x
- the throwable to indicate cause of failureIteratingCallback.onCompleteSuccess()
void terminate(java.lang.Throwable cause)
private void closed(HTTP2Flusher.Entry entry, java.lang.Throwable failure)
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Dumpable
public java.lang.String toString()
toString
in class IteratingCallback