示例#1
0
 public WorkerLifetimeManager(
     ConfigurationInstanceHolder configurationInstanceHolder,
     WorkerConfiguration workerConfiguration,
     IMediator mediator,
     ILogger logger,
     TimeoutHelper timeoutHelper,
     ICustomClock clock,
     IServiceProvider serviceProvider)
 {
     _configurationInstanceHolder = configurationInstanceHolder;
     _workerConfiguration         = workerConfiguration;
     _mediator        = mediator;
     _logger          = logger;
     _timeoutHelper   = timeoutHelper;
     _clock           = clock;
     _serviceProvider = serviceProvider;
 }
示例#2
0
        public DeploymentTargetWorker(
            [NotNull] string targetId,
            [NotNull] DeploymentService deploymentService,
            [NotNull] ILogger logger,
            [NotNull] IMediator mediator,
            [NotNull] WorkerConfiguration workerConfiguration)
        {
            if (string.IsNullOrWhiteSpace(targetId))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(targetId));
            }

            TargetId             = targetId;
            _deploymentService   = deploymentService ?? throw new ArgumentNullException(nameof(deploymentService));
            _logger              = logger ?? throw new ArgumentNullException(nameof(logger));
            _mediator            = mediator ?? throw new ArgumentNullException(nameof(mediator));
            _workerConfiguration = workerConfiguration ?? throw new ArgumentNullException(nameof(workerConfiguration));
        }