Package reactor.netty.quic
Class QuicResources
java.lang.Object
reactor.netty.quic.QuicResources
- All Implemented Interfaces:
Disposable,LoopResources
Hold the default QUIC resources.
- Author:
- Violeta Georgieva
-
Nested Class Summary
Nested classes/interfaces inherited from interface reactor.core.Disposable
Disposable.Composite, Disposable.Swap -
Field Summary
Fields inherited from interface reactor.netty.resources.LoopResources
DEFAULT_IO_SELECT_COUNT, DEFAULT_IO_WORKER_COUNT, DEFAULT_NATIVE, DEFAULT_SHUTDOWN_QUIET_PERIOD, DEFAULT_SHUTDOWN_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_dispose()Dispose underlying resources._disposeLater(Duration quietPeriod, Duration timeout) Dispose underlying resources in a listenable fashion.booleandaemon()voiddispose()This has aNOOPimplementation by default in order to prevent unintended disposal of the global QUIC resources which has a longer lifecycle than regularLoopResources.This has aNOOPimplementation by default in order to prevent unintended disposal of the global QUIC resources which has a longer lifecycle than regularLoopResources.disposeLater(Duration quietPeriod, Duration timeout) This has aNOOPimplementation by default in order to prevent unintended disposal of the global QUIC resources which has a longer lifecycle than regularLoopResources.static voidShutdown the globalQuicResourceswithout resetting them, effectively cleaning up associated resources without creating new ones.Prepare to shut down the globalQuicResourceswithout resetting them, effectively cleaning up associated resources without creating new ones.disposeLoopsLater(Duration quietPeriod, Duration timeout) Prepare to shut down the globalQuicResourceswithout resetting them, effectively cleaning up associated resources without creating new ones.static QuicResourcesget()Return the global QUIC resources for loops.protected static QuicResourcesgetOrCreate(@Nullable LoopResources loops, Function<LoopResources, QuicResources> onNew, String name) Safely check if existing resource exist and proceed to update/cleanup if new resources references are passed.boolean<CHANNEL extends Channel>
CHANNELonChannel(Class<CHANNEL> channelType, EventLoopGroup group) onChannelClass(Class<CHANNEL> channelType, EventLoopGroup group) onClient(boolean useNative) onServer(boolean useNative) onServerSelect(boolean useNative) static QuicResourcesreset()Reset QUIC resources to default and return its instance.static QuicResourcesset(LoopResources loops) Update event loops resources and return the global QUIC resources.
-
Constructor Details
-
QuicResources
-
-
Method Details
-
get
Return the global QUIC resources for loops.- Returns:
- the global QUIC resources for loops
-
reset
Reset QUIC resources to default and return its instance.- Returns:
- the global QUIC resources
-
set
Update event loops resources and return the global QUIC resources. Note: The previousLoopResourceswill be disposed.- Parameters:
loops- a newLoopResourcesto replace the current- Returns:
- the global QUIC resources
-
disposeLoops
public static void disposeLoops()Shutdown the globalQuicResourceswithout resetting them, effectively cleaning up associated resources without creating new ones. This method is NOT blocking. It is implemented as fire-and-forget. UsedisposeLoopsLater()when you need to observe the final status of the operation, combined withMono.block()if you need to synchronously wait for the underlying resources to be disposed. -
disposeLoopsLater
Prepare to shut down the globalQuicResourceswithout resetting them, effectively cleaning up associated resources without creating new ones. This only occurs when the returnedMonois subscribed to. The quiet period will be2sand the timeout will be15s- Returns:
- a
Monotriggering thedisposeLoops()when subscribed to.
-
disposeLoopsLater
Prepare to shut down the globalQuicResourceswithout resetting them, effectively cleaning up associated resources without creating new ones. This only occurs when the returnedMonois subscribed to. It is guaranteed that the disposal of the underlying LoopResources will not happen beforequietPeriodis over. If a task is submitted during thequietPeriod, it is guaranteed to be accepted and thequietPeriodwill start over.- Parameters:
quietPeriod- the quiet period as described abovetimeout- the maximum amount of time to wait until the disposal of the underlying LoopResources regardless if a task was submitted during the quiet period- Returns:
- a
Monotriggering thedisposeLoops()when subscribed to. - Since:
- 0.9.3
-
daemon
public boolean daemon()- Specified by:
daemonin interfaceLoopResources
-
dispose
public void dispose()This has aNOOPimplementation by default in order to prevent unintended disposal of the global QUIC resources which has a longer lifecycle than regularLoopResources. If a disposal of the global QUIC resources is needed,disposeLoops()should be used instead.- Specified by:
disposein interfaceDisposable- Specified by:
disposein interfaceLoopResources
-
disposeLater
This has aNOOPimplementation by default in order to prevent unintended disposal of the global QUIC resources which has a longer lifecycle than regularLoopResources. If a disposal of the global QUIC resources is needed,disposeLoopsLater()should be used instead.- Specified by:
disposeLaterin interfaceLoopResources
-
disposeLater
This has aNOOPimplementation by default in order to prevent unintended disposal of the global QUIC resources which has a longer lifecycle than regularLoopResources. If a disposal of the global QUIC resources is needed,disposeLoopsLater(Duration, Duration)should be used instead.- Specified by:
disposeLaterin interfaceLoopResources
-
isDisposed
public boolean isDisposed()- Specified by:
isDisposedin interfaceDisposable
-
onChannel
public <CHANNEL extends Channel> CHANNEL onChannel(Class<CHANNEL> channelType, EventLoopGroup group) - Specified by:
onChannelin interfaceLoopResources
-
onChannelClass
public <CHANNEL extends Channel> Class<? extends CHANNEL> onChannelClass(Class<CHANNEL> channelType, EventLoopGroup group) - Specified by:
onChannelClassin interfaceLoopResources
-
onClient
- Specified by:
onClientin interfaceLoopResources
-
onServer
- Specified by:
onServerin interfaceLoopResources
-
onServerSelect
- Specified by:
onServerSelectin interfaceLoopResources
-
_dispose
protected void _dispose()Dispose underlying resources. -
_disposeLater
Dispose underlying resources in a listenable fashion. It is guaranteed that the disposal of the underlying LoopResources will not happen beforequietPeriodis over. If a task is submitted during thequietPeriod, it is guaranteed to be accepted and thequietPeriodwill start over.- Parameters:
quietPeriod- the quiet period as described abovetimeout- the maximum amount of time to wait until the disposal of the underlying LoopResources regardless if a task was submitted during the quiet period- Returns:
- the Mono that represents the end of disposal
-
getOrCreate
protected static QuicResources getOrCreate(@Nullable LoopResources loops, Function<LoopResources, QuicResources> onNew, String name) Safely check if existing resource exist and proceed to update/cleanup if new resources references are passed.- Parameters:
loops- the eventual newLoopResourcesonNew- aQuicResourcesfactoryname- a name for resources- Returns:
- an existing or new
QuicResources
-