本文整理汇总了Java中com.lmax.disruptor.util.Util.getSequencesFor方法的典型用法代码示例。如果您正苦于以下问题:Java Util.getSequencesFor方法的具体用法?Java Util.getSequencesFor怎么用?Java Util.getSequencesFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lmax.disruptor.util.Util
的用法示例。
在下文中一共展示了Util.getSequencesFor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: after
import com.lmax.disruptor.util.Util; //导入方法依赖的package包/类
/**
* Create a group of event processors to be used as a dependency.
*
* @param processors the event processors, previously set up with {@link #handleEventsWith(com.lmax.disruptor.EventProcessor...)},
* that will form the barrier for subsequent handlers or processors.
* @return an {@link EventHandlerGroup} that can be used to setup a {@link SequenceBarrier} over the specified event processors.
* @see #after(com.lmax.disruptor.EventHandler[])
*/
public EventHandlerGroup<T> after(final EventProcessor... processors)
{
for (EventProcessor processor : processors)
{
consumerRepository.add(processor);
}
return new EventHandlerGroup<T>(this, consumerRepository, Util.getSequencesFor(processors));
}
示例2: handleEventsWith
import com.lmax.disruptor.util.Util; //导入方法依赖的package包/类
/**
* <p>Set up custom event processors to handle events from the ring buffer. The Disruptor will
* automatically start this processors when {@link #start()} is called.</p>
* <p>
* <p>This method can be used as the start of a chain. For example if the processor <code>A</code> must
* process events before handler <code>B</code>:</p>
* <pre><code>dw.handleEventsWith(A).then(B);</code></pre>
*
* @param processors the event processors that will process events.
* @return a {@link EventHandlerGroup} that can be used to chain dependencies.
*/
public EventHandlerGroup<T> handleEventsWith(final EventProcessor... processors) {
for (final EventProcessor processor : processors) {
consumerRepository.add(processor);
}
return new EventHandlerGroup<T>(this, consumerRepository, Util.getSequencesFor(processors));
}
示例3: after
import com.lmax.disruptor.util.Util; //导入方法依赖的package包/类
/**
* Create a group of event processors to be used as a dependency.
*
* @param processors the event processors, previously set up with {@link #handleEventsWith(com.lmax.disruptor.EventProcessor...)},
* that will form the barrier for subsequent handlers or processors.
* @return an {@link EventHandlerGroup} that can be used to setup a {@link SequenceBarrier} over the specified event processors.
* @see #after(com.lmax.disruptor.EventHandler[])
*/
public EventHandlerGroup<T> after(final EventProcessor... processors) {
for (final EventProcessor processor : processors) {
consumerRepository.add(processor);
}
return new EventHandlerGroup<T>(this, consumerRepository, Util.getSequencesFor(processors));
}