Package io.netty.handler.codec.http2
Interface InboundHttp2ToHttpAdapter.ImmediateSendDetector
-
- Enclosing class:
- InboundHttp2ToHttpAdapter
private static interface InboundHttp2ToHttpAdapter.ImmediateSendDetectorAllows messages to be sent up the pipeline before the next phase in the HTTP message flow is detected.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FullHttpMessagecopyIfNeeded(ByteBufAllocator allocator, FullHttpMessage msg)Determine if a copy must be made after an immediate send happens.booleanmustSendImmediately(FullHttpMessage msg)Determine if the response should be sent immediately, or wait for the end of the stream
-
-
-
Method Detail
-
mustSendImmediately
boolean mustSendImmediately(FullHttpMessage msg)
Determine if the response should be sent immediately, or wait for the end of the stream- Parameters:
msg- The response to test- Returns:
trueif the message should be sent immediately {@code false) if we should wait for the end of the stream
-
copyIfNeeded
FullHttpMessage copyIfNeeded(ByteBufAllocator allocator, FullHttpMessage msg)
Determine if a copy must be made after an immediate send happens.An example of this use case is if a request is received with a 'Expect: 100-continue' header. The message will be sent immediately, and the data will be queued and sent at the end of the stream.
- Parameters:
allocator- TheByteBufAllocatorthat can be used to allocatemsg- The message which has just been sent due tomustSendImmediately(FullHttpMessage)- Returns:
- A modified copy of the
msgornullif a copy is not needed.
-
-