Top Description Inners Fields Constructors Methods
reactor.netty.resources

pack-priv final Class DefaultLoopResources

extends AtomicLong
implements LoopResources
Class Inheritance
All Implemented Interfaces
reactor.netty.resources.LoopResources, reactor.core.Disposable
Imports
java.time.Duration, java.util.concurrent.ThreadFactory, .TimeUnit, java.util.concurrent.atomic.AtomicBoolean, .AtomicLong, .AtomicReference, io.netty.channel.EventLoopGroup, io.netty.channel.nio.NioEventLoopGroup, io.netty.util.concurrent.FastThreadLocalThread, .Future, reactor.core.publisher.Mono, reactor.core.scheduler.NonBlocking, reactor.netty.FutureMono

An adapted global eventLoop handler.
Since
0.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final AtomicReference<EventLoopGroup>
pack-priv final AtomicReference<EventLoopGroup>
pack-priv final AtomicReference<EventLoopGroup>
pack-priv final AtomicReference<EventLoopGroup>
pack-priv final boolean
pack-priv final boolean
pack-priv final String
pack-priv final AtomicBoolean
pack-priv final int
pack-priv final AtomicReference<EventLoopGroup>
pack-priv final AtomicReference<EventLoopGroup>
pack-priv final int

Constructor Summary

AccessConstructor and Description
pack-priv
DefaultLoopResources(String prefix, int workerCount, boolean daemon)

pack-priv
DefaultLoopResources(String prefix, int selectCount, int workerCount, boolean daemon)

pack-priv
DefaultLoopResources(String prefix, int selectCount, int workerCount, boolean daemon, boolean colocate)

Method Summary

Modifier and TypeMethod and Description
pack-priv EventLoopGroup
pack-priv EventLoopGroup
pack-priv EventLoopGroup
pack-priv EventLoopGroup
pack-priv EventLoopGroup
pack-priv EventLoopGroup
public Mono<Void>
disposeLater(Duration
the quiet period as described above
quietPeriod
,
Duration
the maximum amount of time to wait until the disposal of the underlying LoopResources regardless if a task was submitted during the quiet period
timeout
)

Overrides default reactor.netty.resources.LoopResources.disposeLater.

Returns a Mono that triggers the disposal of the underlying LoopResources when subscribed to.
public boolean
isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.
public EventLoopGroup
onClient(boolean
should use native group if current environment supports it
useNative
)

Overrides default reactor.netty.resources.LoopResources.onClient.

Callback for client EventLoopGroup creation.
public EventLoopGroup
onServer(boolean
should use native group if current environment supports it
useNative
)

Implements reactor.netty.resources.LoopResources.onServer.

Callback for server EventLoopGroup creation, this is the EventLoopGroup for the child channel.
public EventLoopGroup
onServerSelect(boolean
should use native group if current environment supports it
useNative
)

Overrides default reactor.netty.resources.LoopResources.onServerSelect.

Callback for server select EventLoopGroup creation, this is the EventLoopGroup for the acceptor channel.
pack-priv static ThreadFactory
public String
toString()

Overrides java.util.concurrent.atomic.AtomicLong.toString.

Returns the String representation of the current value.
Inherited from java.util.concurrent.atomic.AtomicLong:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleaseupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

cacheNativeClientLoopsback to summary
pack-priv final AtomicReference<EventLoopGroup> cacheNativeClientLoops
cacheNativeSelectLoopsback to summary
pack-priv final AtomicReference<EventLoopGroup> cacheNativeSelectLoops
cacheNativeServerLoopsback to summary
pack-priv final AtomicReference<EventLoopGroup> cacheNativeServerLoops
clientLoopsback to summary
pack-priv final AtomicReference<EventLoopGroup> clientLoops
colocateback to summary
pack-priv final boolean colocate
daemonback to summary
pack-priv final boolean daemon
prefixback to summary
pack-priv final String prefix
runningback to summary
pack-priv final AtomicBoolean running
selectCountback to summary
pack-priv final int selectCount
serverLoopsback to summary
pack-priv final AtomicReference<EventLoopGroup> serverLoops
serverSelectLoopsback to summary
pack-priv final AtomicReference<EventLoopGroup> serverSelectLoops
workerCountback to summary
pack-priv final int workerCount

Constructor Detail

DefaultLoopResourcesback to summary
pack-priv DefaultLoopResources(String prefix, int workerCount, boolean daemon)
DefaultLoopResourcesback to summary
pack-priv DefaultLoopResources(String prefix, int selectCount, int workerCount, boolean daemon)
DefaultLoopResourcesback to summary
pack-priv DefaultLoopResources(String prefix, int selectCount, int workerCount, boolean daemon, boolean colocate)

Method Detail

cacheNativeClientLoopsback to summary
pack-priv EventLoopGroup cacheNativeClientLoops()
cacheNativeSelectLoopsback to summary
pack-priv EventLoopGroup cacheNativeSelectLoops()
Annotations
@SuppressWarnings:FutureReturnValueIgnored
cacheNativeServerLoopsback to summary
pack-priv EventLoopGroup cacheNativeServerLoops()
Annotations
@SuppressWarnings:FutureReturnValueIgnored
cacheNioClientLoopsback to summary
pack-priv EventLoopGroup cacheNioClientLoops()
cacheNioSelectLoopsback to summary
pack-priv EventLoopGroup cacheNioSelectLoops()
Annotations
@SuppressWarnings:FutureReturnValueIgnored
cacheNioServerLoopsback to summary
pack-priv EventLoopGroup cacheNioServerLoops()
Annotations
@SuppressWarnings:FutureReturnValueIgnored
disposeLaterback to summary
public Mono<Void> disposeLater(Duration quietPeriod, Duration timeout)

Overrides default reactor.netty.resources.LoopResources.disposeLater.

Doc from reactor.netty.resources.LoopResources.disposeLater.

Returns a Mono that triggers the disposal of the underlying LoopResources when subscribed to. It is guaranteed that the disposal of the underlying LoopResources will not happen before quietPeriod is over. If a task is submitted during the quietPeriod, it is guaranteed to be accepted and the quietPeriod will start over.

Parameters
quietPeriod:Duration

the quiet period as described above

timeout:Duration

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:Mono<Void>

a Mono representing the completion of the LoopResources disposal.

Annotations
@Override
@SuppressWarnings:unchecked
isDisposedback to summary
public boolean isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Doc from reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.

Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.

Returns:boolean

true when there's a guarantee the resource or task is disposed.

Annotations
@Override
onClientback to summary
public EventLoopGroup onClient(boolean useNative)

Overrides default reactor.netty.resources.LoopResources.onClient.

Doc from reactor.netty.resources.LoopResources.onClient.

Callback for client EventLoopGroup creation.

Parameters
useNative:boolean

should use native group if current environment supports it

Returns:EventLoopGroup

a new EventLoopGroup

Annotations
@Override
onServerback to summary
public EventLoopGroup onServer(boolean useNative)

Implements reactor.netty.resources.LoopResources.onServer.

Doc from reactor.netty.resources.LoopResources.onServer.

Callback for server EventLoopGroup creation, this is the EventLoopGroup for the child channel.

Parameters
useNative:boolean

should use native group if current environment supports it

Returns:EventLoopGroup

a new EventLoopGroup

Annotations
@Override
onServerSelectback to summary
public EventLoopGroup onServerSelect(boolean useNative)

Overrides default reactor.netty.resources.LoopResources.onServerSelect.

Doc from reactor.netty.resources.LoopResources.onServerSelect.

Callback for server select EventLoopGroup creation, this is the EventLoopGroup for the acceptor channel.

Parameters
useNative:boolean

should use native group if current environment supports it

Returns:EventLoopGroup

a new EventLoopGroup

Annotations
@Override
threadFactoryback to summary
pack-priv static ThreadFactory threadFactory(DefaultLoopResources parent, String prefix)
toStringback to summary
public String toString()

Overrides java.util.concurrent.atomic.AtomicLong.toString.

Doc from java.util.concurrent.atomic.AtomicLong.toString.

Returns the String representation of the current value.

Returns:String

the String representation of the current value

Annotations
@Override
reactor.netty.resources back to summary

pack-priv final Class DefaultLoopResources.EventLoop

extends FastThreadLocalThread
implements NonBlocking
Class Inheritance
All Implemented Interfaces
reactor.core.scheduler.NonBlocking

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from io.netty.util.concurrent.FastThreadLocalThread:
permitBlockingCallssetThreadLocalMapthreadLocalMapwillCleanupFastThreadLocalswillCleanupFastThreadLocals

Constructor Detail

EventLoopback to summary
pack-priv EventLoop(Runnable target)
reactor.netty.resources back to summary

pack-priv final Class DefaultLoopResources.EventLoopFactory

extends Object
implements ThreadFactory
Class Inheritance
  • java.lang.Object
  • reactor.netty.resources.DefaultLoopResources.EventLoopFactory
All Implemented Interfaces
java.util.concurrent.ThreadFactory

Field Summary

Modifier and TypeField and Description
pack-priv final AtomicLong
pack-priv final boolean
pack-priv final String

Constructor Summary

AccessConstructor and Description
pack-priv
EventLoopFactory(boolean daemon, String prefix, AtomicLong counter)

Method Summary

Modifier and TypeMethod and Description
public Thread
newThread(Runnable
a runnable to be executed by new thread instance
r
)

Implements java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

counterback to summary
pack-priv final AtomicLong counter
daemonback to summary
pack-priv final boolean daemon
prefixback to summary
pack-priv final String prefix

Constructor Detail

EventLoopFactoryback to summary
pack-priv EventLoopFactory(boolean daemon, String prefix, AtomicLong counter)

Method Detail

newThreadback to summary
public Thread newThread(Runnable r)

Implements java.util.concurrent.ThreadFactory.newThread.

Doc from java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.

Parameters
r:Runnable

a runnable to be executed by new thread instance

Returns:Thread

constructed thread, or null if the request to create a thread is rejected

Annotations
@Override