Interface SmartExecutor
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
SmartExecutor.Direct,SmartExecutor.Limited,SmartExecutor.NonClosing,SmartExecutor.Pooled
Utilities for executors and sizing them.
Big fat note: Do not use this class outside of resolver. This and related classes are not meant as "drop
in replacement" for Jave Executors, is used in very controlled fashion only.
- Since:
- 2.0.11
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDirect executor (caller executes).static classLimited executor, where the actual goal is to protect accessed resource, like when virtual threads are being used, so the "pool" itself does not provide any kind of back-pressure.static classWrapper to prevent closing.static classPooled executor backed byExecutorService. -
Method Summary
-
Method Details
-
submit
Submits aRunnableto execution. -
submit
Submits aCallableto execution, returns aCompletableFuture. -
close
void close()Shut down this instance (ideally used in try-with-resource construct).- Specified by:
closein interfaceAutoCloseable
-