Class Http3ServerPushStreamManager
java.lang.Object
io.netty.handler.codec.http3.Http3ServerPushStreamManager
A manager for push streams
for a server. New push streams can be initiated using the various
newPushStream methods. It is required to
add the ChannelHandler returned from controlStreamListener() to the QuicChannel associated
with this manager.-
Constructor Summary
ConstructorsConstructorDescriptionHttp3ServerPushStreamManager(QuicChannel channel) Creates a new instance.Http3ServerPushStreamManager(QuicChannel channel, int initialPushStreamsCountHint) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionAChannelInboundHandlerto be added to theQuicChannelassociated with thisHttp3ServerPushStreamManagerto listen to control stream frames.booleanReturnstrueif server push is allowed at this point.newPushStream(long pushId, @Nullable ChannelHandler handler) Returns a new HTTP/3 push-stream that will use the givenChannelHandlerto dispatchHttp3PushStreamFrames too.voidnewPushStream(long pushId, @Nullable ChannelHandler handler, Promise<QuicStreamChannel> promise) Returns a new HTTP/3 push-stream that will use the givenChannelHandlerto dispatchHttp3PushStreamFrames too.voidnewPushStream(long pushId, @Nullable ChannelHandler handler, UnaryOperator<QuicStreamChannelBootstrap> bootstrapConfigurator, Promise<QuicStreamChannel> promise) Returns a new HTTP/3 push-stream that will use the givenChannelHandlerto dispatchHttp3PushStreamFrames too.longReserves a push ID to be used to create a new push stream subsequently.
-
Constructor Details
-
Http3ServerPushStreamManager
Creates a new instance.- Parameters:
channel- for which this manager is created.
-
Http3ServerPushStreamManager
Creates a new instance.- Parameters:
channel- for which this manager is created.initialPushStreamsCountHint- a hint for the number of push streams that may be created.
-
-
Method Details
-
isPushAllowed
public boolean isPushAllowed()Returnstrueif server push is allowed at this point.- Returns:
trueif server push is allowed at this point.
-
reserveNextPushId
public long reserveNextPushId()Reserves a push ID to be used to create a new push stream subsequently. A push ID can only be used to create exactly one push stream.- Returns:
- Next push ID.
- Throws:
IllegalStateException- If it is not allowed to create any more push streams on the associatedQuicChannel. UseisPushAllowed()to check if server push is allowed.
-
newPushStream
public Future<QuicStreamChannel> newPushStream(long pushId, @Nullable @Nullable ChannelHandler handler) Returns a new HTTP/3 push-stream that will use the givenChannelHandlerto dispatchHttp3PushStreamFrames too. The needed HTTP/3 codecs are automatically added to the pipeline as well.- Parameters:
pushId- for the push stream. This MUST be obtained usingreserveNextPushId().handler- theChannelHandlerto add. Can benull.- Returns:
- the
Futurethat will be notified once the push-stream was opened.
-
newPushStream
public void newPushStream(long pushId, @Nullable @Nullable ChannelHandler handler, Promise<QuicStreamChannel> promise) Returns a new HTTP/3 push-stream that will use the givenChannelHandlerto dispatchHttp3PushStreamFrames too. The needed HTTP/3 codecs are automatically added to the pipeline as well.- Parameters:
pushId- for the push stream. This MUST be obtained usingreserveNextPushId().handler- theChannelHandlerto add. Can benull.promise- to indicate creation of the push stream.
-
newPushStream
public void newPushStream(long pushId, @Nullable @Nullable ChannelHandler handler, UnaryOperator<QuicStreamChannelBootstrap> bootstrapConfigurator, Promise<QuicStreamChannel> promise) Returns a new HTTP/3 push-stream that will use the givenChannelHandlerto dispatchHttp3PushStreamFrames too. The needed HTTP/3 codecs are automatically added to the pipeline as well.- Parameters:
pushId- for the push stream. This MUST be obtained usingreserveNextPushId().handler- theChannelHandlerto add. Can benull.bootstrapConfigurator-UnaryOperatorto configure theQuicStreamChannelBootstrapused.promise- to indicate creation of the push stream.
-
controlStreamListener
AChannelInboundHandlerto be added to theQuicChannelassociated with thisHttp3ServerPushStreamManagerto listen to control stream frames.- Returns:
ChannelInboundHandlerto be added to theQuicChannelassociated with thisHttp3ServerPushStreamManagerto listen to control stream frames.
-