Package com.linecorp.armeria.common.util
Class ThreadFactories
java.lang.Object
com.linecorp.armeria.common.util.ThreadFactories
Provides a builder for
ThreadFactory
.-
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadFactoryBuilder
Returns a new builder which builds a newThreadFactory
.static ThreadFactory
newEventLoopThreadFactory
(String threadNamePrefix, boolean daemon) Creates a newThreadFactory
for event loop thread.static ThreadFactory
newThreadFactory
(String threadNamePrefix, boolean daemon) Creates a newThreadFactory
for non event loop thread.
-
Method Details
-
builder
Returns a new builder which builds a newThreadFactory
.- Parameters:
threadNamePrefix
- the prefix of the names of the threads created by the factory built by this factory builder.
-
newEventLoopThreadFactory
Creates a newThreadFactory
for event loop thread. This is a shortcut method ofThreadFactories.builder("threadNamePrefix").eventLoop(true).daemon(daemon).build()
.- Parameters:
threadNamePrefix
- the prefix of the names of the threads created by this factory.daemon
- whether to create a daemon thread.
-
newThreadFactory
Creates a newThreadFactory
for non event loop thread. This is a shortcut method ofThreadFactories.builder("threadNamePrefix").daemon(daemon).build()
.- Parameters:
threadNamePrefix
- the prefix of the names of the threads created by this factory.daemon
- whether to create a daemon thread.
-