Class ThreadFactories

java.lang.Object
com.linecorp.armeria.common.util.ThreadFactories

public final class ThreadFactories extends Object
Provides a builder for ThreadFactory.
  • Method Details

    • builder

      public static ThreadFactoryBuilder builder(String threadNamePrefix)
      Returns a new builder which builds a new ThreadFactory.
      Parameters:
      threadNamePrefix - the prefix of the names of the threads created by the factory built by this factory builder.
    • newEventLoopThreadFactory

      public static ThreadFactory newEventLoopThreadFactory(String threadNamePrefix, boolean daemon)
      Creates a new ThreadFactory for event loop thread. This is a shortcut method of ThreadFactories.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

      public static ThreadFactory newThreadFactory(String threadNamePrefix, boolean daemon)
      Creates a new ThreadFactory for non event loop thread. This is a shortcut method of ThreadFactories.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.