接口 EventSequencer<T>

所有超级接口:
DataProvider<T>
所有已知实现类:
MpUnboundedEventSequencer, RingBufferEventSequencer

public interface EventSequencer<T> extends DataProvider<T>
事件生成器 事件生成器是SequencerDataProvider的集成,每一种实现通常都和数据结构绑定。
作者:
wjybxx date - 2024/1/15
  • 字段详细资料

    • UNBOUNDED_CAPACITY

      static final int UNBOUNDED_CAPACITY
      无界空间对应的常量
      另请参阅:
  • 方法详细资料

    • capacity

      int capacity()
      数据结构大小 1.如果为【无界】数据结构,则返回-1; 2.如果为【有界】数据结构,则返回真实值。

      The capacity of the data structure to hold entries.

      返回:
      the size of the RingBuffer.
    • remainingCapacity

      long remainingCapacity()
      当前剩余容量 1.并不一定具有价值,因为多线程模型下查询容器的当前大小时,它反映的总是一个旧值。 2.如果为【无界】数据结构,可能返回任意值(大于0),但建议返回Integer.MAX_VALUE。 3.如果为【有界】数据结构,则返回真实的值。

      Get the remaining capacity for this sequencer.

      返回:
      The number of slots remaining.
    • sequencer

      Sequencer sequencer()
      获取序号生成器 -- 用于特殊需求
    • producerBarrier

      ProducerBarrier producerBarrier()
      获取生产者屏障 -- 生产者发布数据
    • addGatingBarriers

      default void addGatingBarriers(SequenceBarrier... gatingBarriers)
      添加一个网关屏障 -- 消费链最末端的消费者屏障
    • removeGatingBarrier

      default boolean removeGatingBarrier(SequenceBarrier gatingBarrier)
      移除一个网关屏障 -- 消费链最末端的消费者屏障
    • newSingleConsumerBarrier

      default ConsumerBarrier newSingleConsumerBarrier(SequenceBarrier... barriersToTrack)
      创建一个【单消费者】的屏障 -- 使用默认的等待策略
    • newSingleConsumerBarrier

      default ConsumerBarrier newSingleConsumerBarrier(WaitStrategy waitStrategy, SequenceBarrier... barriersToTrack)
      创建一个【单消费者】的屏障 -- 使用自定义等待策略
    • newMultiConsumerBarrier

      default ConsumerBarrier newMultiConsumerBarrier(int workerCount, SequenceBarrier... barriersToTrack)
      创建一个【多消费者】的屏障 -- 使用自定义等待策略
    • newMultiConsumerBarrier

      default ConsumerBarrier newMultiConsumerBarrier(int workerCount, WaitStrategy waitStrategy, SequenceBarrier... barriersToTrack)
      创建一个【多消费者】的屏障 -- 使用自定义等待策略
    • hasAvailableCapacity

      default boolean hasAvailableCapacity(int requiredCapacity)
    • next

      default long next()
    • next

      default long next(int n)
    • tryNext

      default long tryNext()
    • tryNext

      default long tryNext(int n)
    • nextInterruptibly

      default long nextInterruptibly() throws InterruptedException
      抛出:
      InterruptedException
    • nextInterruptibly

      default long nextInterruptibly(int n) throws InterruptedException
      抛出:
      InterruptedException
    • tryNext

      default long tryNext(int n, long timeout, TimeUnit unit)
    • publish

      default void publish(long sequence)
    • publish

      default void publish(long lo, long hi)