Class SharedExecutorService

java.lang.Object
com.azure.core.util.SharedExecutorService
All Implemented Interfaces:
AutoCloseable, Executor, ExecutorService, ScheduledExecutorService

public final class SharedExecutorService extends Object implements ScheduledExecutorService
An ScheduledExecutorService that is shared by multiple consumers.

If setExecutorService(ScheduledExecutorService) isn't called a default shared executor service is created using the following configuration settings:

  • azure.sdk.shared.threadpool.maxpoolsize system property or AZURE_SDK_SHARED_THREADPOOL_MAXPOOLSIZE environment variable - The maximum pool size of the shared executor service. If not set, it defaults to 10 times the number of available processors.
  • azure.sdk.shared.threadpool.keepalivemillis system property or {code AZURE_SDK_SHARED_THREADPOOL_KEEPALIVEMILLIS} environment variable - The keep alive time in millis for threads in the shared executor service. If not set, it defaults to 60 seconds. Limited to integer size.
  • azure.sdk.shared.threadpool.usevirtualthreads system property or AZURE_SDK_SHARED_THREADPOOL_USEVIRTUALTHREADS environment variable - A boolean flag to indicate if the shared executor service should use virtual threads. If not set, it defaults to true. Ignored if virtual threads are not available in the runtime.