All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.rx.groovy.RxGroovyMethods Maven / Gradle / Ivy

package io.vertx.rx.groovy;

import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.groovy.core.Vertx;
import io.vertx.groovy.core.streams.ReadStream;
import io.vertx.rx.java.RxHelper;
import rx.Observable;
import rx.Observer;
import rx.Scheduler;

/**
 * A set of Groovy extensions for Rxifying the Groovy API.
 *
 * @author Julien Viet
 */
public class RxGroovyMethods {

  public static  Observable toObservable(ReadStream stream) {
    return Observable.create(new HandlerAdapter<>(stream));
  }

  public static Handler> toFuture(Observer observer) {
    return RxHelper.toFuture(observer);
  }

  public static Handler toHandler(Observer observer) {
    return RxHelper.toHandler(observer);
  }

  public static Scheduler scheduler(Vertx vertx) {
    return RxHelper.scheduler((io.vertx.core.Vertx) vertx.getDelegate());
  }

  public static Scheduler blockingScheduler(Vertx vertx) {
    return RxHelper.blockingScheduler((io.vertx.core.Vertx) vertx.getDelegate());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy