Interface BlockingManager.BlockingExecutor

Enclosing interface:
BlockingManager

public static interface BlockingManager.BlockingExecutor
Executor interface that submits task to a blocking pool that returns a stage that is guaranteed to run any chained stages on a non-blocking thread if the stage is not yet complete.

Note that this executor runs the task in the invoking thread if the thread is a blocking thread.

  • Method Details

    • execute

      CompletionStage<Void> execute(Runnable runnable, Object traceId)
      Executes the given runnable on the blocking executor. The traceId is printed in the invoking thread, in the blocking thread, and also during resumption of the non-blocking thread.
      Parameters:
      runnable - blocking operation that runs some code.
      traceId - an identifier that can be used to tell in a trace when an operation moves between threads.
      Returns:
      a stage that is completed after the runnable is done or throws an exception.
    • supply

      <V> CompletionStage<V> supply(Supplier<V> supplier, Object traceId)
      Executes the given supplier on the blocking executor. The traceId is printed in the invoking thread, in the blocking thread, and also during resumption of the non-blocking thread.
      Type Parameters:
      V - supplier type.
      Parameters:
      supplier - blocking operation that returns a value.
      traceId - an identifier that can be used to tell in a trace when an operation moves between threads.
      Returns:
      a stage that, when complete, contains the value returned from the supplier or a throwable.