Class BlockingCode

java.lang.Object
net.bluemind.lib.vertx.BlockingCode

@Deprecated public class BlockingCode extends Object
Deprecated.
use Vertx.executeBlocking(io.vertx.core.Handler, io.vertx.core.Handler) instead
Helper inspired by vertx 3 to run blocking code from an event loop context.
  • Method Details

    • withExecutor

      public BlockingCode withExecutor(ExecutorService pool)
      Deprecated.
      the executor is not used anymore
      Provide your own executor where the blocking code will run.
      Parameters:
      pool -
      Returns:
    • forVertx

      public static BlockingCode forVertx(io.vertx.core.Vertx v)
      Deprecated.
      Creates a BlockingCode executor to use in a vertx event loop. DISCLAIMER: Do not call that with VertxPlatform.getVertx() but with the vertx instance from your verticle
      Parameters:
      v -
      Returns:
    • run

      public <T> CompletableFuture<T> run(Supplier<T> supplier)
      Deprecated.
      Returns a future that will execute its followers in the vertx context associated with this instance
      Parameters:
      supplier -
      Returns:
      a future for with the result of the given supplier