Created
August 17, 2018 17:09
-
-
Save anitaa1990/f249bcd1be6f562220d923b14e073e41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This will print values from 0 after every second. | |
*/ | |
Observable.interval(1, TimeUnit.SECONDS) | |
.subscribe(new Observer<Long>() { | |
@Override | |
public void onSubscribe(Disposable d) { | |
} | |
@Override | |
public void onNext(Long value) { | |
System.out.println("onNext: " + value); | |
} | |
@Override | |
public void onError(Throwable e) { | |
System.out.println("onError: " + e.getMessage()); | |
} | |
@Override | |
public void onComplete() { | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment