查看本类的 API文档回源码主页即时通讯网 - 即时通讯开发者社区!
1   package io.netty.util.internal.shaded.org.jctools.queues;
2   
3   /**
4    * This interface is provided for monitoring purposes only and is only available on queues where it is easy to
5    * provide it. The producer/consumer progress indicators usually correspond with the number of elements
6    * offered/polled, but they are not guaranteed to maintain that semantic.
7    */
8   public interface QueueProgressIndicators
9   {
10  
11      /**
12       * This method has no concurrent visibility semantics. The value returned may be negative. Under normal
13       * circumstances 2 consecutive calls to this method can offer an idea of progress made by producer threads
14       * by subtracting the 2 results though in extreme cases (if producers have progressed by more than 2^64)
15       * this may also fail.<br/>
16       * This value will normally indicate number of elements passed into the queue, but may under some
17       * circumstances be a derivative of that figure. This method should not be used to derive size or
18       * emptiness.
19       *
20       * @return the current value of the producer progress index
21       */
22      long currentProducerIndex();
23  
24      /**
25       * This method has no concurrent visibility semantics. The value returned may be negative. Under normal
26       * circumstances 2 consecutive calls to this method can offer an idea of progress made by consumer threads
27       * by subtracting the 2 results though in extreme cases (if consumers have progressed by more than 2^64)
28       * this may also fail.<br/>
29       * This value will normally indicate number of elements taken out of the queue, but may under some
30       * circumstances be a derivative of that figure. This method should not be used to derive size or
31       * emptiness.
32       *
33       * @return the current value of the consumer progress index
34       */
35      long currentConsumerIndex();
36  }