当前位置: 首页>>代码示例>>Java>>正文


Java Util.getSequencesFor方法代码示例

本文整理汇总了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));
}
 
开发者ID:wen866595,项目名称:annotated-src,代码行数:18,代码来源:Disruptor.java

示例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));
}
 
开发者ID:winwill2012,项目名称:disruptor-code-analysis,代码行数:18,代码来源:Disruptor.java

示例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));
}
 
开发者ID:winwill2012,项目名称:disruptor-code-analysis,代码行数:16,代码来源:Disruptor.java


注:本文中的com.lmax.disruptor.util.Util.getSequencesFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。