Interface SmartExecutor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  SmartExecutor.Direct
      Direct executor (caller executes).
      static class  SmartExecutor.Limited
      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  SmartExecutor.NonClosing
      Wrapper to prevent closing.
      static class  SmartExecutor.Pooled
      Pooled executor backed by ExecutorService.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Shut down this instance (ideally used in try-with-resource construct).
      void submit​(java.lang.Runnable runnable)
      Submits a Runnable to execution.
      <T> java.util.concurrent.Future<T> submit​(java.util.concurrent.Callable<T> callable)
      Submits a Callable to execution, returns a CompletableFuture.
    • Method Detail

      • submit

        void submit​(java.lang.Runnable runnable)
        Submits a Runnable to execution.
      • submit

        <T> java.util.concurrent.Future<T> submit​(java.util.concurrent.Callable<T> callable)
        Submits a Callable to execution, returns a CompletableFuture.
      • close

        void close()
        Shut down this instance (ideally used in try-with-resource construct).
        Specified by:
        close in interface java.lang.AutoCloseable