Class NettyThreadFactory.EventLoopCustomizableThreadFactory
java.lang.Object
io.micronaut.http.netty.channel.NettyThreadFactory.EventLoopCustomizableThreadFactory
- All Implemented Interfaces:
ThreadFactory
- Enclosing class:
NettyThreadFactory
@Internal
public static final class NettyThreadFactory.EventLoopCustomizableThreadFactory
extends Object
implements ThreadFactory
We only create one ThreadFactory singleton, but in order to get different names for
different event loops, we need one
DefaultThreadFactory for each event loop. When
the event loop factory sees this class, it uses it as a template to create an individual
ThreadFactory for each event loop group.- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe thread pool name used when no event loop group name is given. -
Constructor Summary
ConstructorsConstructorDescriptionEventLoopCustomizableThreadFactory(boolean daemon, int priority, boolean nonBlocking) -
Method Summary
Modifier and TypeMethodDescriptioncustomizeForEventLoop(String poolName) Create a thread factory for a single event loop group, using the given thread pool name so that its threads can be told apart from those of other event loop groups.
-
Field Details
-
DEFAULT_POOL_NAME
The thread pool name used when no event loop group name is given.- See Also:
-
-
Constructor Details
-
EventLoopCustomizableThreadFactory
public EventLoopCustomizableThreadFactory(boolean daemon, int priority, boolean nonBlocking)
-
-
Method Details
-
customizeForEventLoop
-
customizeForEventLoop
Create a thread factory for a single event loop group, using the given thread pool name so that its threads can be told apart from those of other event loop groups.- Parameters:
poolName- The thread pool name- Returns:
- The thread factory for the event loop group
- Since:
- 5.2.0
-
newThread
- Specified by:
newThreadin interfaceThreadFactory
-