Package io.netty.util

Class Recycler.BlockingMessageQueue<T>

java.lang.Object
io.netty.util.Recycler.BlockingMessageQueue<T>
All Implemented Interfaces:
org.jctools.queues.MessagePassingQueue<T>
Enclosing class:
Recycler<T>

private static final class Recycler.BlockingMessageQueue<T> extends Object implements org.jctools.queues.MessagePassingQueue<T>
This is an implementation of MessagePassingQueue, similar to what might be returned from PlatformDependent.newMpscQueue(int), but intended to be used for debugging purpose. The implementation relies on synchronised monitor locks for thread-safety. The fill bulk operation is not supported by this implementation.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.jctools.queues.MessagePassingQueue

    org.jctools.queues.MessagePassingQueue.Consumer<T>, org.jctools.queues.MessagePassingQueue.ExitCondition, org.jctools.queues.MessagePassingQueue.Supplier<T>, org.jctools.queues.MessagePassingQueue.WaitStrategy
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Queue<T>
     
    private final int
     

    Fields inherited from interface org.jctools.queues.MessagePassingQueue

    UNBOUNDED_CAPACITY
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockingMessageQueue(int maxCapacity)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    void
     
    int
    drain(org.jctools.queues.MessagePassingQueue.Consumer<T> c)
     
    int
    drain(org.jctools.queues.MessagePassingQueue.Consumer<T> c, int limit)
     
    void
    drain(org.jctools.queues.MessagePassingQueue.Consumer<T> c, org.jctools.queues.MessagePassingQueue.WaitStrategy wait, org.jctools.queues.MessagePassingQueue.ExitCondition exit)
     
    int
    fill(org.jctools.queues.MessagePassingQueue.Supplier<T> s)
     
    int
    fill(org.jctools.queues.MessagePassingQueue.Supplier<T> s, int limit)
     
    void
    fill(org.jctools.queues.MessagePassingQueue.Supplier<T> s, org.jctools.queues.MessagePassingQueue.WaitStrategy wait, org.jctools.queues.MessagePassingQueue.ExitCondition exit)
     
    boolean
     
    boolean
    offer(T e)
     
     
     
    boolean
     
     
     
    int
     

    Methods inherited from class java.lang.Object

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

    • deque

      private final Queue<T> deque
    • maxCapacity

      private final int maxCapacity
  • Constructor Details

    • BlockingMessageQueue

      BlockingMessageQueue(int maxCapacity)
  • Method Details

    • offer

      public boolean offer(T e)
      Specified by:
      offer in interface org.jctools.queues.MessagePassingQueue<T>
    • poll

      public T poll()
      Specified by:
      poll in interface org.jctools.queues.MessagePassingQueue<T>
    • peek

      public T peek()
      Specified by:
      peek in interface org.jctools.queues.MessagePassingQueue<T>
    • size

      public int size()
      Specified by:
      size in interface org.jctools.queues.MessagePassingQueue<T>
    • clear

      public void clear()
      Specified by:
      clear in interface org.jctools.queues.MessagePassingQueue<T>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.jctools.queues.MessagePassingQueue<T>
    • capacity

      public int capacity()
      Specified by:
      capacity in interface org.jctools.queues.MessagePassingQueue<T>
    • relaxedOffer

      public boolean relaxedOffer(T e)
      Specified by:
      relaxedOffer in interface org.jctools.queues.MessagePassingQueue<T>
    • relaxedPoll

      public T relaxedPoll()
      Specified by:
      relaxedPoll in interface org.jctools.queues.MessagePassingQueue<T>
    • relaxedPeek

      public T relaxedPeek()
      Specified by:
      relaxedPeek in interface org.jctools.queues.MessagePassingQueue<T>
    • drain

      public int drain(org.jctools.queues.MessagePassingQueue.Consumer<T> c, int limit)
      Specified by:
      drain in interface org.jctools.queues.MessagePassingQueue<T>
    • fill

      public int fill(org.jctools.queues.MessagePassingQueue.Supplier<T> s, int limit)
      Specified by:
      fill in interface org.jctools.queues.MessagePassingQueue<T>
    • drain

      public int drain(org.jctools.queues.MessagePassingQueue.Consumer<T> c)
      Specified by:
      drain in interface org.jctools.queues.MessagePassingQueue<T>
    • fill

      public int fill(org.jctools.queues.MessagePassingQueue.Supplier<T> s)
      Specified by:
      fill in interface org.jctools.queues.MessagePassingQueue<T>
    • drain

      public void drain(org.jctools.queues.MessagePassingQueue.Consumer<T> c, org.jctools.queues.MessagePassingQueue.WaitStrategy wait, org.jctools.queues.MessagePassingQueue.ExitCondition exit)
      Specified by:
      drain in interface org.jctools.queues.MessagePassingQueue<T>
    • fill

      public void fill(org.jctools.queues.MessagePassingQueue.Supplier<T> s, org.jctools.queues.MessagePassingQueue.WaitStrategy wait, org.jctools.queues.MessagePassingQueue.ExitCondition exit)
      Specified by:
      fill in interface org.jctools.queues.MessagePassingQueue<T>