Example #1
0
 public CommandExecuter(IQueueClient queueClient, IConfig config, IWorkerRecordStoreService workerRecordStoreService, ICommandDispatcher dispatch, IDirectCommandExecuter directCommandExecuter)
 {
     _queueClient = queueClient;
     _config      = config;
     _workerRecordStoreService = workerRecordStoreService;
     _dispatch = dispatch;
     _directCommandExecuter = directCommandExecuter;
 }
 public WorkerManager(ICommandDispatcher dispatcher, IQueueClient queueClient, IConfig config, IWorkerRecordStoreService workerRecordStoreService, ITime time)
 {
     _dispatcher  = dispatcher;
     _queueClient = queueClient;
     _config      = config;
     _workerRecordStoreService = workerRecordStoreService;
     _time = time;
 }
        private FinalReducer FinalReducerFactory(
            IQueueClient queueClient = null,
            IConfig config           = null,
            IWorkerRecordStoreService workerRecordStoreService = null,
            ICommandDispatcher commandDispatcher = null)
        {
            queueClient = CheckParam(queueClient);
            config      = CheckParam(config);
            workerRecordStoreService = CheckParam(workerRecordStoreService);
            commandDispatcher        = CheckParam(commandDispatcher);

            var finalReducer = new FinalReducer(queueClient, config, workerRecordStoreService, commandDispatcher);

            return(finalReducer);
        }
        private Ingester IngestorFactory(
            IQueueClient queueClient = null,
            IConfig config           = null,
            IWorkerRecordStoreService workerRecordStoreService = null,
            ICommandDispatcher commandDispatcher = null)
        {
            queueClient = CheckParam(queueClient);
            config      = CheckParam(config);
            workerRecordStoreService = CheckParam(workerRecordStoreService);
            commandDispatcher        = CheckParam(commandDispatcher);

            var ingester = new Ingester(queueClient, config, workerRecordStoreService, commandDispatcher);

            return(ingester);
        }
        private Reducer ReducerFactory(
            IQueueClient queueClient = null,
            IConfig config           = null,
            IWorkerRecordStoreService workerRecordStoreService = null,
            ICommandDispatcher commandDispatcher = null)
        {
            queueClient = CheckParam(queueClient);
            config      = CheckParam(config);
            workerRecordStoreService = CheckParam(workerRecordStoreService);

            commandDispatcher = CheckParam(commandDispatcher);
            commandDispatcher.RegisterReducerFunc(new MostAccidentProneReducer());

            var redcuer = new Reducer(queueClient, config, workerRecordStoreService, commandDispatcher);

            return(redcuer);
        }
Example #6
0
        private WorkerManager WorkerManagerFactory(
            ICommandDispatcher commandDispatcher = null,
            IQueueClient queueClient             = null,
            IConfig config = null,
            IWorkerRecordStoreService workerRecordStoreService = null,
            ITime time = null)
        {
            if (commandDispatcher == null)
            {
                commandDispatcher = Substitute.For <ICommandDispatcher>();
            }

            if (queueClient == null)
            {
                queueClient = Substitute.For <IQueueClient>();
            }

            if (config == null)
            {
                config = Substitute.For <IConfig>();
            }

            if (workerRecordStoreService == null)
            {
                workerRecordStoreService = Substitute.For <IWorkerRecordStoreService>();
            }

            if (time == null)
            {
                time = Substitute.For <ITime>();
            }

            var workerManager = new WorkerManager(commandDispatcher, queueClient, config, workerRecordStoreService, time);

            return(workerManager);
        }