Created
August 19, 2018 13:35
-
-
Save anitaa1990/07f27f8b0a164355255237ea0120bc0c 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
Completable.create(new CompletableOnSubscribe() { | |
@Override | |
public void subscribe(CompletableEmitter emitter) { | |
Thread.sleep(1000); | |
emitter.onComplete(); | |
} | |
}) | |
.subscribeOn(Schedulers.io()) | |
.subscribe(new CompletableObserver() { | |
@Override | |
public void onSubscribe(Disposable d) { | |
} | |
@Override | |
public void onComplete() { | |
System.out.println("onComplete is called"); | |
} | |
@Override | |
public void onError(Throwable e) { | |
System.out.println("onError is called" + e.getMessage()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment