org.jboss.resteasy.reactive.server.handlers.UniResponseHandler Maven / Gradle / Ivy
package org.jboss.resteasy.reactive.server.handlers;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
import org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext;
import org.jboss.resteasy.reactive.server.spi.ServerRestHandler;
import io.smallrye.mutiny.Uni;
import io.smallrye.mutiny.subscription.Cancellable;
public class UniResponseHandler implements ServerRestHandler {
@Override
public void handle(ResteasyReactiveRequestContext requestContext) throws Exception {
// FIXME: handle Response with entity being a Uni
if (requestContext.getResult() instanceof Uni> result) {
requestContext.suspend();
AtomicBoolean done = new AtomicBoolean();
Cancellable cancellable = result.subscribe().with(new Consumer
© 2015 - 2024 Weber Informatics LLC | Privacy Policy