daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. final List<Record> records = //...
  2. final ExecutorService executorService = Executors.newFixedThreadPool(10);
  3. for (final Record record : records) {
  4.     executorService.submit(new Runnable() {
  5.         @Override
  6.         public void run() {
  7.             //process record here
  8.         }
  9.     });
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top