Guest User

Untitled

a guest
Jul 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. List<String> A = aService.getListA();
  2. List<Integer> B = bService.getListB();
  3.  
  4. ExecutorService es = Executors.newFixedThreadPool(2);
  5. Future<List<String>> getAs = es.submit(() -> aService.getListA());
  6. Future<List<Int>> getBs = es.submit(() -> bService.getListB());
  7. es.shutdown();
Add Comment
Please, Sign In to add comment