コード例 #1
0
 /// <summary>
 /// Set up a worker pool to handle events from the ring buffer. The worker pool will only process events
 /// after every <see cref="IEventProcessor"/> in this group has processed the event. Each event will be processed
 /// by one of the work handler instances.
 ///
 /// This method is generally used as part of a chain. For example if the handler <code>A</code> must
 /// process events before the worker pool with handlers <code>B, C</code>:
 /// <code>dw.After(A).HandleEventsWithWorkerPool(B, C);</code>
 /// </summary>
 /// <param name="handlers">handlers the work handlers that will process events. Each work handler instance will provide an extra thread in the worker pool.</param>
 /// <returns>a <see cref="EventHandlerGroup{T}"/> that can be used to set up a event processor barrier over the created event processors.</returns>
 public EventHandlerGroup <T> HandleEventsWithWorkerPool(IWorkHandler <T>[] handlers) => _disruptor.CreateWorkerPool(_sequences, handlers);
コード例 #2
0
 /// <summary>
 /// Set up a worker pool to handle events from the ring buffer. The worker pool will only process events
 /// after every {@link EventProcessor} in this group has processed the event. Each event will be processed
 /// by one of the work handler instances.
 ///
 /// <p>This method is generally used as part of a chain. For example if the handler <code>A</code> must
 /// process events before the worker pool with handlers <code>B, C</code>:</p>
 ///
 /// <pre><code>dw.after(A).handleEventsWithWorkerPool(B, C);</code></pre>
 /// </summary>
 /// <param name="handlers">the work handlers that will process events. Each work handler instance will provide an extra thread in the worker pool.</param>
 /// <returns>a {@link EventHandlerGroup} that can be used to set up a event processor barrier over the created event processors.</returns>
 public EventHandlerGroup <T> HandleEventsWithWorkerPool(params IWorkHandler <T>[] handlers)
 {
     return(disruptor.CreateWorkerPool(sequences, handlers));
 }