io.quarkus.oidc.runtime.BlockingTaskRunner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-oidc Show documentation
Show all versions of quarkus-oidc Show documentation
Secure your applications with OpenID Connect Adapter and IDP such as Keycloak
package io.quarkus.oidc.runtime;
import java.util.function.Supplier;
import io.quarkus.arc.Arc;
import io.quarkus.oidc.OidcRequestContext;
import io.quarkus.security.spi.runtime.BlockingSecurityExecutor;
import io.smallrye.mutiny.Uni;
public class BlockingTaskRunner implements OidcRequestContext {
private final BlockingSecurityExecutor blockingExecutor;
public BlockingTaskRunner() {
this.blockingExecutor = new BlockingSecurityExecutor() {
private volatile BlockingSecurityExecutor delegate = null;
@Override
public Uni executeBlocking(Supplier extends O> supplier) {
if (delegate == null) {
delegate = Arc.container().select(BlockingSecurityExecutor.class).get();
}
return delegate.executeBlocking(supplier);
}
};
}
public BlockingTaskRunner(BlockingSecurityExecutor blockingExecutor) {
this.blockingExecutor = blockingExecutor;
}
public Uni runBlocking(Supplier function) {
return blockingExecutor.executeBlocking(function);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy