Last active
January 7, 2018 21:05
-
-
Save pvllnspk/45e9f51150a62b5252656f3e2d806be4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 1. | |
| for(int i = 0; i < threads.size(); i++) { | |
| threads.get(i).start(); | |
| threads.get(i).join(); | |
| } | |
| 2. | |
| String result = executorService.submit(callable).get(); | |
| List<Callable<String>> callables = ... | |
| List<Future<String>> results = executorService.invokeAll(callables); | |
| for(Future<String> future: results){ | |
| result+= future.get(); | |
| } | |
| for (int i = 0; i < n; ++i) { | |
| Future<String> result = executorCompletionService.take(); | |
| } | |
| 3. | |
| Observable.zip( , ,new BiFunction() { | |
| @Override | |
| public List<User> apply() throws Exception { | |
| } | |
| }) | |
| .subscribeOn(Schedulers.io()) | |
| .observeOn(AndroidSchedulers.mainThread()) | |
| .subscribe(getObserver()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment