All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.charlemaznable.bunny.plugin.elf.VertxElf Maven / Gradle / Ivy

Go to download

Bunny rabbits will skip hand-in-hand with baby lambs across sunny green meadows.

The newest version!
package com.github.charlemaznable.bunny.plugin.elf;

import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;

import java.util.Map;

public final class VertxElf {

    private VertxElf() {
        throw new UnsupportedOperationException();
    }

    public static  void executeBlocking(
            Map contextMap,
            Handler> blockingCodeHandler,
            Handler> resultHandler) {
        Vertx.currentContext().executeBlocking(block -> {
            try {
                MtcpElf.preHandle(contextMap);
                blockingCodeHandler.handle(block);
            } catch (Exception e) {
                block.fail(e);
            } finally {
                MtcpElf.afterCompletion();
            }
        }, false, resultHandler);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy