Class ProducerConsumerWithTake<T>

java.lang.Object
io.deephaven.base.queue.ProducerConsumerWithTake<T>
All Implemented Interfaces:
ProducerConsumer<T>

public class ProducerConsumerWithTake<T> extends Object implements ProducerConsumer<T>
  • Constructor Details

    • ProducerConsumerWithTake

      public ProducerConsumerWithTake(ProducerConsumer<T> producerConsumer)
  • Method Details

    • produce

      public boolean produce(T t)
      Description copied from interface: ProducerConsumer
      This method should never block (but it may spin for a finite amount of time) Returns true when t was successfully produced, else false
      Specified by:
      produce in interface ProducerConsumer<T>
    • consume

      public T consume()
      Description copied from interface: ProducerConsumer
      This method should never block (but it may spin for a finite amount of time) Returns null when there is nothing to consume [may create new objects on the fly if necessary]
      Specified by:
      consume in interface ProducerConsumer<T>
    • take

      public T take()
    • size

      public int size()