在通过container.deployVerticle部署的verticle中运行时,Observable.create会在groovy.lang.MissingMethodException中产生结果

在通过container.deployVerticle部署的verticle中运行时,Observable.create会在groovy.lang.MissingMethodException中产生结果,groovy,vert.x,rx-java,Groovy,Vert.x,Rx Java,Groovy verticle中的异常(Bar.start) groovy.lang.MissingMethodException:没有方法签名:static rx.Observable.create()适用 类装入器问题?不确定。container.deployVerticle垂直体将使用父类加载器 马文: import rx.* class Foo extends Verticle { def start() { // This works: prints 1

Groovy verticle中的异常(Bar.start) groovy.lang.MissingMethodException:没有方法签名:static rx.Observable.create()适用

类装入器问题?不确定。container.deployVerticle垂直体将使用父类加载器

马文:

import rx.*
class Foo extends Verticle {
    def start() {

        // This works:  prints 1
        Observable.create({ s -> s.onNext(1); s.onCompleted()}).subscribe({println it});

        container.deployVerticle("groovy:path.to.Bar")
    }
}

class Bar extends Verticle {
    def start() {
         // This fails
         Observable.create({ s -> s.onNext(1); s.onCompleted()}).subscribe({println it});
    }
}

com.netflix.rxjava
rxjava内核
0.17.2
com.netflix.rxjava
rxjavagroovy
0.17.2
Vert.x版本:2.1M5


谢谢

请小心使用可用的API。在rxjavawiki中描述了许多函数,但其中一些函数没有在语言适配器中实现。我确信Scala中是这样,但Groovy中可能也是这样。有时方法甚至有不同的名称,如Java中的“switchOnNext”和Scala中的“switch”

  <dependency>
      <groupId>com.netflix.rxjava</groupId>
      <artifactId>rxjava-core</artifactId>
      <version>0.17.2</version>
  </dependency>

  <dependency>
      <groupId>com.netflix.rxjava</groupId>
      <artifactId>rxjava-groovy</artifactId>
      <version>0.17.2</version>
  </dependency>