Class SimpleExecutorsModule

java.lang.Object
com.google.inject.PrivateModule
dev.getelements.elements.rt.guice.SimpleExecutorsModule
All Implemented Interfaces:
com.google.inject.Module

public class SimpleExecutorsModule extends com.google.inject.PrivateModule
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    Determines the default number of scheduler threads as the number of available processors plus one.
    withSchedulerThreads(int threads)
    Specifies the number of scheduler threads.

    Methods inherited from class com.google.inject.PrivateModule

    addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, expose, expose, expose, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleExecutorsModule

      public SimpleExecutorsModule()
  • Method Details

    • withDefaultSchedulerThreads

      public SimpleExecutorsModule withDefaultSchedulerThreads()
      Determines the default number of scheduler threads as the number of available processors plus one.
      Returns:
      this instance
    • withSchedulerThreads

      public SimpleExecutorsModule withSchedulerThreads(int threads)
      Specifies the number of scheduler threads. This number typically can be set low as the actual scheduler threads defer their work to a cached thread pool. Typically this is set to 1+ the currently availble CPUs
      Parameters:
      threads - the number of threads
      Returns:
      this instance
    • configure

      protected void configure()
      Specified by:
      configure in class com.google.inject.PrivateModule