Class NettyHttpServerConfiguration.EventLoopConfig

java.lang.Object
io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration.EventLoopConfig
All Implemented Interfaces:
Named, EventLoopGroupConfiguration
Direct Known Subclasses:
NettyHttpServerConfiguration.Parent, NettyHttpServerConfiguration.Worker
Enclosing class:
NettyHttpServerConfiguration

public abstract static class NettyHttpServerConfiguration.EventLoopConfig extends Object implements EventLoopGroupConfiguration
Abstract class for configuring the Netty event loop.
  • Method Details

    • getName

      @NonNull public @NonNull String getName()
      Specified by:
      getName in interface Named
      Returns:
      The name of the component
    • setEventLoopGroup

      public void setEventLoopGroup(String name)
      Sets the name to use.
      Parameters:
      name - The name
    • setThreads

      public void setThreads(int threads)
      Sets the number of threads for the event loop group.
      Parameters:
      threads - The number of threads
    • setIoRatio

      public void setIoRatio(Integer ioRatio)
      Sets the I/O ratio.
      Parameters:
      ioRatio - The I/O ratio
    • setExecutor

      public void setExecutor(String executor)
      Sets the name of the executor.
      Parameters:
      executor - The executor
    • setPreferNativeTransport

      public void setPreferNativeTransport(boolean preferNativeTransport)
      Parameters:
      preferNativeTransport - Set whether to prefer the native transport if available
    • setShutdownQuietPeriod

      public void setShutdownQuietPeriod(Duration shutdownQuietPeriod)
      Parameters:
      shutdownQuietPeriod - Set the shutdown quiet period
    • setShutdownTimeout

      public void setShutdownTimeout(Duration shutdownTimeout)
      Parameters:
      shutdownTimeout - Set the shutdown timeout (must be >= shutdownQuietPeriod)
    • getNumOfThreads

      public int getNumOfThreads()
      Returns:
      The number of threads to use
    • getIoRatio

      public Optional<Integer> getIoRatio()
      Specified by:
      getIoRatio in interface EventLoopGroupConfiguration
      Returns:
      The I/O ratio to use
    • getExecutorName

      public Optional<String> getExecutorName()
      Specified by:
      getExecutorName in interface EventLoopGroupConfiguration
      Returns:
      The name of the configured executor to use
    • getNumThreads

      public int getNumThreads()
      Specified by:
      getNumThreads in interface EventLoopGroupConfiguration
      Returns:
      The number of threads for the event loop
    • isPreferNativeTransport

      public boolean isPreferNativeTransport()
      Specified by:
      isPreferNativeTransport in interface EventLoopGroupConfiguration
      Returns:
      Whether to prefer the native transport
    • getShutdownQuietPeriod

      public Duration getShutdownQuietPeriod()
      Specified by:
      getShutdownQuietPeriod in interface EventLoopGroupConfiguration
      Returns:
      The shutdown quiet period
    • getShutdownTimeout

      public Duration getShutdownTimeout()
      Specified by:
      getShutdownTimeout in interface EventLoopGroupConfiguration
      Returns:
      The shutdown timeout (must be >= shutdownQuietPeriod)