Interface IoExecutor

All Superinterfaces:
AsyncCloseable, Executor, Executor, ListenableAsyncCloseable, TimeSource
All Known Subinterfaces:
EventLoopAwareNettyIoExecutor, NettyIoExecutor

public interface IoExecutor extends Executor
Executor that handles IO.
  • Method Details

    • isUnixDomainSocketSupported

      boolean isUnixDomainSocketSupported()
      Determine if Unix Domain Sockets are supported.
      Returns:
      true if Unix Domain Sockets are supported.
    • isFileDescriptorSocketAddressSupported

      boolean isFileDescriptorSocketAddressSupported()
      Determine if fd addresses are supported.
      Returns:
      true if supported
    • isIoThreadSupported

      boolean isIoThreadSupported()
      Determine if threads used by this IoExecutor are marked with IoThreadFactory.IoThread interface.
      Returns:
      true if supported
      See Also:
    • shouldOffloadSupplier

      default BooleanSupplier shouldOffloadSupplier()
      Returns a boolean supplier, if this IoExecutor supports IoThreadFactory.IoThread markers, that conditionally recommends offloading if the current thread is an IO thread. If this IoExecutor does not support IoThread marker interface then the boolean supplier will always return true.
      Returns:
      a Boolean supplier to recommend offloading appropriately based upon IoExecutor configuration.
    • execute

      default Cancellable execute(Runnable task) throws RejectedExecutionException
      Description copied from interface: Executor
      Executes the passed task as soon as possible.
      Specified by:
      execute in interface Executor
      Parameters:
      task - to execute.
      Returns:
      Cancellable to cancel the task if not yet executed.
      Throws:
      RejectedExecutionException - If the task is rejected.
    • schedule

      default Cancellable schedule(Runnable task, long delay, TimeUnit unit) throws RejectedExecutionException
      Description copied from interface: Executor
      Executes the passed task after delay amount of units time has passed.

      Note this method is not guaranteed to provide real time execution. For example implementations are free to consolidate tasks into time buckets to reduce the overhead of timer management at the cost of reduced timer fidelity.

      Specified by:
      schedule in interface Executor
      Parameters:
      task - to execute.
      delay - The time duration that is allowed to elapse before task is executed.
      unit - The units for delay.
      Returns:
      Cancellable to cancel the task if not yet executed.
      Throws:
      RejectedExecutionException - If the task is rejected.