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 class
Direct executor (caller executes).static class
Limited 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 class
Wrapper to prevent closing.static class
Pooled executor backed byExecutorService
. -
Method Summary
-
Method Details
-
submit
Submits aRunnable
to execution. -
submit
Submits aCallable
to execution, returns aCompletableFuture
. -
close
void close()Shut down this instance (ideally used in try-with-resource construct).- Specified by:
close
in interfaceAutoCloseable
-