Exemple #1
0
            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>(() => { });
                }
            }
Exemple #3
0
 public Producer(DoubleBufferedQueueManager <IMeasurement> manager)
 {
     Measurements  = new List <IMeasurement>();
     QueueProducer = manager.GetProducer();
 }
 public Producer(DoubleBufferedQueueManager<IMeasurement> manager)
 {
     Measurements = new List<IMeasurement>();
     QueueProducer = manager.GetProducer();
 }