reactivefeign.rx2.methodhandler.Rx2MethodHandler Maven / Gradle / Ivy
The newest version!
package reactivefeign.rx2.methodhandler;
import io.reactivex.Flowable;
import io.reactivex.Maybe;
import io.reactivex.Observable;
import io.reactivex.Single;
import org.reactivestreams.Publisher;
import reactivefeign.methodhandler.MethodHandler;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.lang.reflect.Type;
import static reactor.adapter.rxjava.RxJava2Adapter.*;
public class Rx2MethodHandler implements MethodHandler {
private final MethodHandler methodHandler;
private final Type returnPublisherType;
public Rx2MethodHandler(MethodHandler methodHandler, Type returnPublisherType) {
this.methodHandler = methodHandler;
this.returnPublisherType = returnPublisherType;
}
@Override
@SuppressWarnings("unchecked")
public Object invoke(final Object[] argv) {
try {
Publisher