Esempio n. 1
0
 public void Dispose()
 {
     if (_disruptor != null)
     {
         _disruptor.Dispose();
         _disruptor = null;
     }
 }
Esempio n. 2
0
        public PublishDisruptor(IEndpoint endpoint, int maxSize, int bufferSize, ILoader loader)
        {
            var list = new IEventHandler <PublishData>[]
            {
                new EventMarshaler(maxSize, loader),
                new EventPublisher(endpoint),
            };

            _disruptor = new DataHandlingSequencer <PublishData>(SequencerFactoryEntry.NewPublishData, bufferSize);
            _disruptor.SetFunctions(list).HandleExeceptionWith(new ExceptionHandler <PublishData>());
            //ghi nhan du lieu
            _disruptor.Start();
        }
Esempio n. 3
0
        public ReceiveDisruptor(IProcess processor, int bufferSize, bool isWorker = false, bool isBStarMode = false, WorkerType?workerType = null)
        {
            _disruptor = new DataHandlingSequencer <ReceiveData>(SequencerFactoryEntry.NewReceiveData, bufferSize);
            var listTasks = new IEventHandler <ReceiveData>[]
            {
                new EventUnMarshaler(processor, isWorker, isBStarMode),
                new EventProcessor(processor)
            };

            _disruptor.SetFunctions(listTasks).HandleExeceptionWith(new ExceptionHandler <ReceiveData>());

            //ghi nhan du lieu chay
            _disruptor.Start();
        }
Esempio n. 4
0
 public void Dispose()
 {
     try
     {
         if (_disruptor != null)
         {
             _disruptor.Dispose();
         }
     }
     catch (Exception ex)
     {
         LogTo.Error(ex.ToString());
     }
     finally
     {
         _disruptor = null;
     }
 }