/// <summary>
 /// Create a new UnmanagedDisruptor.
 /// </summary>
 /// <param name="pointer">pointer to the first event of the buffer</param>
 /// <param name="eventSize">size of each event</param>
 /// <param name="ringBufferSize">the number of events of the ring buffer, must be power of 2</param>
 /// <param name="taskScheduler">a <see cref="TaskScheduler"/> to create threads for processors</param>
 /// <param name="producerType">the claim strategy to use for the ring buffer</param>
 /// <param name="waitStrategy">the wait strategy to use for the ring buffer</param>
 public UnmanagedDisruptor(IntPtr pointer, int eventSize, int ringBufferSize, TaskScheduler taskScheduler, ProducerType producerType, IWaitStrategy waitStrategy)
     : this(new UnmanagedRingBuffer <T>(pointer, eventSize, SequencerFactory.Create(producerType, ringBufferSize, waitStrategy)), new BasicExecutor(taskScheduler))
 {
 }
示例#2
0
 /// <summary>
 /// Create a new UnmanagedDisruptor. Will default to <see cref="BlockingWaitStrategy"/> and <see cref="ProducerType.Multi"/>.
 /// </summary>
 /// <param name="pointer">pointer to the first event of the buffer</param>
 /// <param name="eventSize">size of each event</param>
 /// <param name="ringBufferSize">the number of events of the ring buffer, must be power of 2</param>
 /// <param name="taskScheduler">a <see cref="TaskScheduler"/> to create threads for processors</param>
 public UnmanagedDisruptor(IntPtr pointer, int eventSize, int ringBufferSize, TaskScheduler taskScheduler)
     : this(new UnmanagedRingBuffer <T>(pointer, eventSize, SequencerFactory.Create(ProducerType.Multi, ringBufferSize)), taskScheduler)
 {
 }
 /// <summary>
 /// Create a new UnmanagedDisruptor. Will default to <see cref="BlockingWaitStrategy"/> and <see cref="ProducerType.Multi"/>.
 /// </summary>
 /// <param name="pointer">pointer to the first event of the buffer</param>
 /// <param name="eventSize">size of each event</param>
 /// <param name="ringBufferSize">the number of events of the ring buffer, must be power of 2</param>
 /// <param name="executor">an <see cref="IExecutor"/> to create threads for processors</param>
 public UnmanagedDisruptor(IntPtr pointer, int eventSize, int ringBufferSize, IExecutor executor)
     : this(new UnmanagedRingBuffer <T>(pointer, eventSize, SequencerFactory.Create(ProducerType.Multi, ringBufferSize)), executor)
 {
 }
示例#4
0
 /// <summary>
 /// Create a new ValueDisruptor.
 /// </summary>
 /// <param name="eventFactory">the factory to create events in the ring buffer</param>
 /// <param name="ringBufferSize">the size of the ring buffer, must be power of 2</param>
 /// <param name="taskScheduler">a <see cref="TaskScheduler"/> to create threads for processors</param>
 /// <param name="producerType">the claim strategy to use for the ring buffer</param>
 /// <param name="waitStrategy">the wait strategy to use for the ring buffer</param>
 public ValueDisruptor(Func <T> eventFactory, int ringBufferSize, TaskScheduler taskScheduler, ProducerType producerType, IWaitStrategy waitStrategy)
     : this(new ValueRingBuffer <T>(eventFactory, SequencerFactory.Create(producerType, ringBufferSize, waitStrategy)), taskScheduler)
 {
 }