Class Worker


  • public class Worker
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.concurrent.ExecutorService executor  
      protected java.util.LinkedList<java.util.concurrent.Future<?>> futures  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void await()  
      void execute​(java.lang.Runnable runnable)  
      <T> java.util.concurrent.Future<T> submit​(java.util.concurrent.Callable<T> callable)  
      <I> void submitAndAwait​(java.util.Collection<I> is, java.util.function.Consumer<I> consumer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • futures

        protected final java.util.LinkedList<java.util.concurrent.Future<?>> futures
      • executor

        protected java.util.concurrent.ExecutorService executor
    • Method Detail

      • execute

        public void execute​(java.lang.Runnable runnable)
      • submit

        public <T> java.util.concurrent.Future<T> submit​(java.util.concurrent.Callable<T> callable)
      • await

        public void await()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • submitAndAwait

        public <I> void submitAndAwait​(java.util.Collection<I> is,
                                       java.util.function.Consumer<I> consumer)
                                throws java.io.IOException
        Throws:
        java.io.IOException