Class MpscPool<T>

  • Type Parameters:
    T -

    public class MpscPool<T>
    extends Pool<T>
    A simple encapsulation of Netty MpscQueue to provide a pool of objects. Use this pool only when the borrowing of object (consume) is done on a single thread. This is using a Multi Producer Single Consumer queue (MPSC). If you need other uses you may create different strategies for ObjectPooling.
    • Constructor Summary

      Constructors 
      Constructor Description
      MpscPool​(int maxSize, java.util.function.Consumer<T> cleaner, java.util.function.Supplier<T> supplier)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Queue<T> createQueue​(int maxSize)  
      • Methods inherited from class org.apache.activemq.artemis.utils.pools.Pool

        borrow, release
      • Methods inherited from class java.lang.Object

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

      • MpscPool

        public MpscPool​(int maxSize,
                        java.util.function.Consumer<T> cleaner,
                        java.util.function.Supplier<T> supplier)
    • Method Detail

      • createQueue

        protected java.util.Queue<T> createQueue​(int maxSize)