Package com.google.mu.util.concurrent
Class StructuredConcurrencyExecutorPlugin
java.lang.Object
com.google.mu.util.concurrent.StructuredConcurrencyExecutorPlugin
SPI Used by
ServiceLoader
to plug in the executor used by Fanout
.
Steps to create a plugin:
- Create a public subclass of
StructuredConcurrencyExecutorPlugin
and overridecreateExecutor()
. - Annotate your class with
@AutoService(StructuredConcurrencyExecutorPlugin.class)
.
- Since:
- 8.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Plugin priority from low to high. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ExecutorService
Subclasses override this method to create the executor that runs all structured concurrency fanout tasks.priority()
Returns the priority of this plugin when multiple plugins are available.toString()
-
Constructor Details
-
StructuredConcurrencyExecutorPlugin
public StructuredConcurrencyExecutorPlugin()
-
-
Method Details
-
createExecutor
Subclasses override this method to create the executor that runs all structured concurrency fanout tasks. The returned executor will be used as a singleton and never shut down. It's recommended for the executor to use virtual and daemon threads. -
priority
Returns the priority of this plugin when multiple plugins are available. Defaults toStructuredConcurrencyExecutorPlugin.Priority.FRAMEWORK_STANDARD
, intended for server frameworks to implement. -
toString
-