Package com.packtpub.java7.concurrency.chapter7.recipe01.executor

Examples of com.packtpub.java7.concurrency.chapter7.recipe01.executor.MyExecutor.submit()


    /*
     * Create and submit to the executor 10 tasks
     */
    for (int i=0; i<10; i++) {
      SleepTwoSecondsTask task=new SleepTwoSecondsTask();
      Future<String> result=myExecutor.submit(task);
      results.add(result);
    }
   
    /*
     * Get the result of the execution of the first five tasks
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.