コード例 #1
0
 public CommandExecuter(IQueueClient queueClient, IConfig config, IWorkerRecordStoreService workerRecordStoreService, ICommandDispatcher dispatch, IDirectCommandExecuter directCommandExecuter)
 {
     _queueClient = queueClient;
     _config      = config;
     _workerRecordStoreService = workerRecordStoreService;
     _dispatch = dispatch;
     _directCommandExecuter = directCommandExecuter;
 }
コード例 #2
0
 public WorkerManager(ICommandDispatcher dispatcher, IQueueClient queueClient, IConfig config, IWorkerRecordStoreService workerRecordStoreService, ITime time)
 {
     _dispatcher  = dispatcher;
     _queueClient = queueClient;
     _config      = config;
     _workerRecordStoreService = workerRecordStoreService;
     _time = time;
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #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);
        }