Class AsyncTaskReader


public class AsyncTaskReader extends ProxyReader
A proxy that uses multiple threads to process incoming data, where the work applied to the incoming data is specified by the a DataReaderDecorator. This reader creates the number of threads specified, divides the incoming data amongst the thread evenly, and decorates each thread's reader with the specified task.
  • Constructor Details

    • AsyncTaskReader

      public AsyncTaskReader(DataReader input, DataReaderDecorator task, int threads)
      Creates a new AsyncTaskReader to process incoming data using multiple threads.
      Parameters:
      input - The incoming data stream to process
      task - The work to apply to the incoming data
      threads - The number of threads to use to process the incoming data
  • Method Details