-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Description
When I run the following snippet:
static Action1<Long> onNextFunc(final String who) {
return new Action1<Long>() {
public void call(Long x) {
System.out.println(who + " got " + x);
}
};
}
static Action1<Throwable> onErrorFunc(final String who) {
return new Action1<Throwable>() {
public void call(Throwable t) {
t.printStackTrace();
}
};
}
static Action0 onCompleteFunc(final String who) {
return new Action0() {
public void call() {
System.out.println(who + " complete");
}
};
}
public static void main(String[] args) {
Observable<Long> oneNumberPerSecond = Observable.interval(1, TimeUnit.SECONDS).take(5);
oneNumberPerSecond.subscribe(onNextFunc("subscriber 1"), onErrorFunc("subscriber 1"), onCompleteFunc("subscriber 1"));
}then I get (as expected) the following output:
subscriber 1 got 0
subscriber 1 got 1
subscriber 1 got 2
subscriber 1 got 3
subscriber 1 got 4
subscriber 1 complete
However, the program does not terminate, and that's unexpected.
I ran this test using rxjava-core-0.13.2-SNAPSHOT.jar built from commit 00d7c3b (Sat Sep 14 08:37:09 2013 -0700).
Due to this problem, some tests in the RxScalaDemo that I'm working on do not terminate, which is annoying.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels