io.quarkus.smallrye.graphql.runtime.spi.datafetcher.BlockingHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-smallrye-graphql Show documentation
Show all versions of quarkus-smallrye-graphql Show documentation
Create GraphQL Endpoints using the code-first approach from MicroProfile GraphQL
package io.quarkus.smallrye.graphql.runtime.spi.datafetcher;
import java.util.concurrent.Callable;
import io.smallrye.graphql.schema.model.Execute;
import io.smallrye.graphql.schema.model.Operation;
import io.vertx.core.Context;
import io.vertx.core.Promise;
public final class BlockingHelper {
private BlockingHelper() {
}
public static boolean blockingShouldExecuteNonBlocking(Operation operation, Context vc) {
// Rule is that by default this should execute blocking except if marked as non-blocking)
return operation.getExecute().equals(Execute.NON_BLOCKING);
}
public static boolean nonBlockingShouldExecuteBlocking(Operation operation, Context vc) {
// Rule is that by default this should execute non-blocking except if marked as blocking
return operation.getExecute().equals(Execute.BLOCKING) && vc.isEventLoopContext();
}
@SuppressWarnings("unchecked")
public static void runBlocking(Context vc, Callable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy