Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import io.reactivex.Completable;
- import io.reactivex.schedulers.Schedulers;
- public class Test {
- static int v = 0;
- public static void main(String[] args){
- Completable.create(e -> {v = 1; e.onComplete();})
- .subscribeOn(Schedulers.io())
- .observeOn(Schedulers.computation())
- .subscribe(() -> System.out.println(v));
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment