public Consumer(IAdapter adapter, Action <Exception> exceptionAction) { IActionAdapter actionAdapter = adapter as IActionAdapter; IOutputAdapter outputAdapter; Adapter = adapter; if ((object)actionAdapter != null) { Manager = new DoubleBufferedQueueManager <IMeasurement>(measurements => actionAdapter.QueueMeasurementsForProcessing(new List <IMeasurement>(measurements)), exceptionAction); } else { outputAdapter = adapter as IOutputAdapter; if ((object)outputAdapter != null) { Manager = new DoubleBufferedQueueManager <IMeasurement>(measurements => outputAdapter.QueueMeasurementsForProcessing(new List <IMeasurement>(measurements)), exceptionAction); } else { Manager = new DoubleBufferedQueueManager <IMeasurement>(() => { }); } } }
public Consumer(IAdapter adapter, Action<Exception> exceptionAction) { IActionAdapter actionAdapter = adapter as IActionAdapter; IOutputAdapter outputAdapter; Adapter = adapter; if ((object)actionAdapter != null) { Manager = new DoubleBufferedQueueManager<IMeasurement>(measurements => actionAdapter.QueueMeasurementsForProcessing(new List<IMeasurement>(measurements)), exceptionAction); } else { outputAdapter = adapter as IOutputAdapter; if ((object)outputAdapter != null) Manager = new DoubleBufferedQueueManager<IMeasurement>(measurements => outputAdapter.QueueMeasurementsForProcessing(new List<IMeasurement>(measurements)), exceptionAction); else Manager = new DoubleBufferedQueueManager<IMeasurement>(() => { }); } }
public Producer(DoubleBufferedQueueManager <IMeasurement> manager) { Measurements = new List <IMeasurement>(); QueueProducer = manager.GetProducer(); }
public Producer(DoubleBufferedQueueManager<IMeasurement> manager) { Measurements = new List<IMeasurement>(); QueueProducer = manager.GetProducer(); }