Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError: rx.functions.Actions.onErrorFrom(Lrx/Observer;) #4

Closed
ayedo opened this issue Dec 19, 2014 · 2 comments
Closed

NoSuchMethodError: rx.functions.Actions.onErrorFrom(Lrx/Observer;) #4

ayedo opened this issue Dec 19, 2014 · 2 comments

Comments

@ayedo
Copy link

ayedo commented Dec 19, 2014

The following code throws a:

java.lang.NoSuchMethodError: rx.functions.Actions.onErrorFrom(Lrx/Observer;)Lrx/functions/Action1;

What went wrong?

import rx.lang.scala.ImplicitFunctionConversions._
import rx.lang.scala.JavaConversions._

def sendIndexFromThread(s: Subject[Int], repeats: Int) = new Thread(new Runnable {
    def run() {
      var i = 0
      while (i < repeats) {
        s.onNext(i)
        i = i + 1
      }
      s.onCompleted()
    }
})

val internalSize = 1024

val s1 = Subject[Int]
val s2 = Subject[Int]

val o1 = s1.onBackpressureBuffer.observeOn(NewThreadScheduler())
val o2 = s2.onBackpressureBuffer.observeOn(NewThreadScheduler())

val gotAll = new CountDownLatch(internalSize * 2)
val latch = new CountDownLatch(1)
val counter = new AtomicInteger(0)

val p1 = JoinObservable.from(o1).then((x: Int) => {
  counter.incrementAndGet()
  if (counter.get == (internalSize * 2)) { latch.countDown }
})
val p2 = JoinObservable.from(o2).then((x: Int) => {
  counter.incrementAndGet()
  if (counter.get == (internalSize * 2)) { latch.countDown }
})

val obs = JoinObservable.when(p1, p2).toObservable

obs.subscribe((_: Unit) => gotAll.countDown, (_: Throwable) => (), () => ())

val thread1 = sendIndexFromThread(s1, internalSize)
val thread2 = sendIndexFromThread(s2, internalSize)

thread1.start()
thread2.start()

latch.await
gotAll.await

thread1.join()
thread2.join()
@ayedo
Copy link
Author

ayedo commented Dec 19, 2014

Is the problem above related to: this RxJava issue?

@ayedo ayedo closed this as completed Dec 19, 2014
@ayedo ayedo reopened this Dec 19, 2014
@akarnokd
Copy link
Member

RxJava had some utility class changes which broke other depending projects. This should be fixed now and expect a new release in a few hours on maven central.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants