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

io.smallrye.faulttolerance.vertx.VertxEventLoop Maven / Gradle / Ivy

There is a newer version: 6.7.1
Show newest version
package io.smallrye.faulttolerance.vertx;

import java.util.concurrent.Executor;

import io.smallrye.faulttolerance.core.event.loop.EventLoop;
import io.vertx.core.Context;
import io.vertx.core.Vertx;

public final class VertxEventLoop implements EventLoop {
    @Override
    public boolean isEventLoopThread() {
        return Context.isOnEventLoopThread();
    }

    private void checkEventLoopThread() {
        if (!isEventLoopThread()) {
            throw new UnsupportedOperationException();
        }
    }

    @Override
    public Executor executor() {
        checkEventLoopThread();
        return new VertxExecutor(Vertx.currentContext());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy