Class DefaultAsyncExecutorProvider

java.lang.Object
io.smallrye.faulttolerance.DefaultAsyncExecutorProvider
All Implemented Interfaces:
AsyncExecutorProvider

@Singleton public class DefaultAsyncExecutorProvider extends Object implements AsyncExecutorProvider
Default implementation of AsyncExecutorProvider. Manages its own thread pool.

If integrators don't want to manage the fault tolerance thread pool, yet still want to customize the thread factory, they can provide an @Alternative bean which inherits from this class.

  • Constructor Details

    • DefaultAsyncExecutorProvider

      @Inject public DefaultAsyncExecutorProvider(OptionalInt mainThreadPoolSize, OptionalInt mainThreadPoolQueueSize, OptionalInt globalThreadPoolSize)
  • Method Details

    • get

      public ExecutorService get()
      Description copied from interface: AsyncExecutorProvider
      Provides the thread pool for executing @Asynchronous methods and other asynchronous tasks. Integrator is responsible for the thread pool's lifecycle.
      Specified by:
      get in interface AsyncExecutorProvider
    • threadFactory

      protected ThreadFactory threadFactory()
      Can be overridden in a subclass to provide a different ThreadFactory. Useful e.g. in a Jakarta EE container, where the threads must be managed.