
io.quarkus.vertx.http.runtime.ThreadLocalHandler Maven / Gradle / Ivy
package io.quarkus.vertx.http.runtime;
import java.util.function.Supplier;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;
public class ThreadLocalHandler implements Handler {
private final ThreadLocal> threadLocal;
public ThreadLocalHandler(Supplier> supplier) {
threadLocal = new ThreadLocal>() {
@Override
protected Handler initialValue() {
return supplier.get();
}
};
}
@Override
public void handle(RoutingContext event) {
threadLocal.get().handle(event);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy