public void Dispose() { if (_disruptor != null) { _disruptor.Dispose(); _disruptor = null; } }
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(); }
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(); }
public void Dispose() { try { if (_disruptor != null) { _disruptor.Dispose(); } } catch (Exception ex) { LogTo.Error(ex.ToString()); } finally { _disruptor = null; } }