Class ProduceConsume

  • All Implemented Interfaces:
    java.lang.Runnable, ExecutionStrategy

    public class ProduceConsume
    extends java.lang.Object
    implements ExecutionStrategy, java.lang.Runnable

    A strategy where the caller thread iterates over task production, submitting each task to an Executor for execution.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispatch()
      Initiates (or resumes) the task production and consumption.
      void produce()
      Initiates (or resumes) the task production and consumption.
      void run()  
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • dispatch

        public void dispatch()
        Description copied from interface: ExecutionStrategy

        Initiates (or resumes) the task production and consumption.

        This method guarantees that the task is never run by the thread that called this method.

        TODO review the need for this (only used by HTTP2 push)
        Specified by:
        dispatch in interface ExecutionStrategy
        See Also:
        ExecutionStrategy.produce()
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable