private class HTTP2Session.ControlEntry extends HTTP2Flusher.Entry
Callback.Completable, Callback.Completing, Callback.Nested
Invocable.InvocationType
Modifier and Type | Field and Description |
---|---|
private int |
frameBytes |
frame, stream
__nonBlocking
Modifier | Constructor and Description |
---|---|
private |
ControlEntry(Frame frame,
IStream stream,
Callback callback) |
Modifier and Type | Method and Description |
---|---|
private void |
beforeSend()
Performs actions just before writing the frame to the network.
|
void |
failed(java.lang.Throwable x)
Callback invoked when the operation fails.
|
protected boolean |
generate(ByteBufferPool.Lease lease) |
int |
getFrameBytesGenerated() |
long |
onFlushed(long bytes) |
void |
succeeded()
Callback invoked when the operation completes.
|
getDataBytesRemaining, toString
getCallback, getInvocationType
completed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInvocationType, invokeNonBlocking, isNonBlockingInvocation
public int getFrameBytesGenerated()
getFrameBytesGenerated
in class HTTP2Flusher.Entry
protected boolean generate(ByteBufferPool.Lease lease)
generate
in class HTTP2Flusher.Entry
public long onFlushed(long bytes)
onFlushed
in class HTTP2Flusher.Entry
private void beforeSend()
Performs actions just before writing the frame to the network.
Some frame, when sent over the network, causes the receiver
to react and send back frames that may be processed by the original
sender *before* succeeded()
is called.
If the action to perform updates some state, this update may not be seen by the received frames and cause errors.
For example, suppose the action updates the stream window to a larger value; the sender sends the frame; the receiver is now entitled to send back larger data; when the data is received by the original sender, the action may have not been performed yet, causing the larger data to be rejected, when it should have been accepted.
public void succeeded()
Callback
Callback invoked when the operation completes.
succeeded
in interface Callback
succeeded
in class Callback.Nested
Callback.failed(Throwable)
public void failed(java.lang.Throwable x)
Callback
Callback invoked when the operation fails.
failed
in interface Callback
failed
in class HTTP2Flusher.Entry
x
- the reason for the operation failure