コード例 #1
0
        public void Start()
        {
            messageDisrupter = new Disruptor<RingbufferByteArray>(() => new RingbufferByteArray(), new SingleThreadedClaimStrategy(ringbufferSize), new SleepingWaitStrategy(), TaskScheduler.Default);

            // Switch to this line to use busy spin input queue
            //messageDisrupter = new Disruptor<RingbufferByteArray>(() => new RingbufferByteArray(), new SingleThreadedClaimStrategy(ringbufferSize), new BusySpinWaitStrategy(), TaskScheduler.Default);

            messageDisrupter.HandleEventsWith(messageProcessor).Then(performanceRecorder);
            messageDisrupter.HandleExceptionsWith(new IncomingMessageQueueErrorHandler());
            messageRingBuffer = messageDisrupter.Start();
            performanceRecorder.Setup(messageRingBuffer, 5000);

            logger.Info("Incoming message queue started.");
        }
コード例 #2
0
 public void Start()
 {
     requestDisrupter = new Disruptor<OutputQueueItem>(() => new OutputQueueItem(), (int)Math.Pow(16, 2), TaskScheduler.Default);
     requestDisrupter.HandleEventsWith(eventHandlers);
     requestRingBuffer = requestDisrupter.Start();
 }
コード例 #3
0
        public void Start()
        {
            messageDisrupter = new Disruptor<ServerToClientMessage>(() => new ServerToClientMessage(), new SingleThreadedClaimStrategy(ringbufferSize), new SleepingWaitStrategy(), TaskScheduler.Default);
            messageDisrupter.HandleEventsWith(publisher);
            messageRingBuffer = messageDisrupter.Start();

            logger.Info("Outgoing queue message queue started.");
        }