Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Created August 19, 2018 09:15
Show Gist options
  • Save anitaa1990/e6e50132c6e1116e9c0c2fffe5a4d18e to your computer and use it in GitHub Desktop.
Save anitaa1990/e6e50132c6e1116e9c0c2fffe5a4d18e to your computer and use it in GitHub Desktop.
Observable.interval(100, TimeUnit.MILLISECONDS)
.take(3)
.timeInterval()
.subscribe(new Subject<Timed<Long>>() {
@Override
public boolean hasObservers() {
return false;
}
@Override
public boolean hasThrowable() {
return false;
}
@Override
public boolean hasComplete() {
return false;
}
@Override
public Throwable getThrowable() {
return null;
}
@Override
protected void subscribeActual(Observer<? super Timed<Long>> observer) {
}
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(Timed<Long> longTimed) {
System.out.println("onNext: " + longTimed);
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
Thread.sleep(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment