public final class ThreadFactories extends Object
ThreadFactory.| Modifier and Type | Method and Description |
|---|---|
static ThreadFactoryBuilder |
builder(String threadNamePrefix)
Returns a new builder which builds a new
ThreadFactory. |
static ThreadFactory |
newEventLoopThreadFactory(String threadNamePrefix,
boolean daemon)
Creates a new
ThreadFactory for event loop thread. |
static ThreadFactory |
newThreadFactory(String threadNamePrefix,
boolean daemon)
Creates a new
ThreadFactory for non event loop thread. |
public static ThreadFactoryBuilder builder(String threadNamePrefix)
ThreadFactory.threadNamePrefix - the prefix of the names of the threads created by the factory
built by this factory builder.public static ThreadFactory newEventLoopThreadFactory(String threadNamePrefix, boolean daemon)
ThreadFactory for event loop thread.
This is a shortcut method of
ThreadFactories.builder("threadNamePrefix").eventLoop(true).daemon(daemon).build().threadNamePrefix - the prefix of the names of the threads created by this factory.daemon - whether to create a daemon thread.public static ThreadFactory newThreadFactory(String threadNamePrefix, boolean daemon)
ThreadFactory for non event loop thread.
This is a shortcut method of ThreadFactories.builder("threadNamePrefix").daemon(daemon).build().threadNamePrefix - the prefix of the names of the threads created by this factory.daemon - whether to create a daemon thread.Copyright © 2020 LeanCloud. All rights reserved.