コード例 #1
0
 public MonitorLoop(IBackgroundTaskQueue backgroundTaskQueue,
                    ILogger <MonitorLoop> logger,
                    IHostApplicationLifetime hostApplicationLifetime)
 {
     this.backgroundTaskQueue = backgroundTaskQueue;
     this.logger       = logger;
     cancellationToken = hostApplicationLifetime.ApplicationStopping;
 }
コード例 #2
0
ファイル: Timer.cs プロジェクト: unglaublicherdude/motornet
 public Timer(IOptions <TimerOptions> config,
              IBackgroundTaskQueue <MotorCloudEvent <IJobExecutionContext> > queue,
              IApplicationNameService applicationNameService)
 {
     _queue = queue;
     _applicationNameService = applicationNameService;
     _options = config.Value ?? throw new ArgumentNullException(nameof(config));
 }
コード例 #3
0
ファイル: MonitorLoop.cs プロジェクト: kohei3110/AspNetCore
 public MonitorLoop(IBackgroundTaskQueue taskQueue,
                    ILogger <MonitorLoop> logger,
                    IHostApplicationLifetime applicationLifetime)
 {
     _taskQueue         = taskQueue;
     _logger            = logger;
     _cancellationToken = applicationLifetime.ApplicationStopping;
 }
コード例 #4
0
 public ServerTemplatesController(PlatformResourcesContext context, IAmazonEC2 ec2Client, IBackgroundTaskQueue Queue, IApplicationLifetime appLifetime, ILogger <ChallengeServersController> logger)
 {
     this._context   = context;
     this.EC2Client  = ec2Client;
     Backgroundqueue = Queue;
     _appLifetime    = appLifetime;
     _logger         = logger;
 }
コード例 #5
0
 public ElmahIoMiddleware(RequestDelegate next, IBackgroundTaskQueue queue, IOptions <ElmahIoOptions> options)
 {
     _next    = next;
     _queue   = queue;
     _options = options.Value;
     _options.ApiKey.AssertApiKey();
     _options.LogId.AssertLogId();
 }
コード例 #6
0
 public WorkFlowExecutorService(IWorkFlowCreatorService <WorkFlow> workFlowCreatorService, IWorkFlowContext workFlowContext, IUserManager <GearUser> userManager, ILogger <WorkFlowExecutorService> logger, IBackgroundTaskQueue backgroundTaskQueue)
 {
     _workFlowCreatorService = workFlowCreatorService;
     _workFlowContext        = workFlowContext;
     _userManager            = userManager;
     _logger = logger;
     _backgroundTaskQueue = backgroundTaskQueue;
 }
コード例 #7
0
 // ReSharper disable once TooManyDependencies
 public PersonGenerationService(ILogger <PersonGenerationService> logger, IBackgroundTaskQueue taskQueue,
                                IBuilding building, ISettingsService settingsService)
 {
     _logger          = logger;
     _taskQueue       = taskQueue;
     _building        = building;
     _settingsService = settingsService;
 }
コード例 #8
0
 public SignupMessageSubscriber(IBackgroundTaskQueue taskQueue, ILogger <SignupMessageSubscriber> logger, IApplicationLifetime applicationLifetime, IConnection rabbitMQConn, ICourseService courseService)
 {
     _taskQueue         = taskQueue;
     _logger            = logger;
     _cancellationToken = applicationLifetime.ApplicationStopping;
     _rabbitMQConn      = rabbitMQConn;
     _courseService     = courseService;
 }
コード例 #9
0
ファイル: MonitorLoop.cs プロジェクト: drawmoon/mynotes
        public MonitorLoop(IEnumerable <IBackgroundTask> backgroudTasks, IBackgroundTaskQueue backgroundTaskQueue, IHostApplicationLifetime hostApplicationLifetime)
        {
            _backgroudTasks      = backgroudTasks;
            _backgroundTaskQueue = backgroundTaskQueue;
            _stoppingToken       = hostApplicationLifetime.ApplicationStopping;

            Task.Run(() => Monitor());
        }
コード例 #10
0
 // Assigning the references for the readonly member from the DI
 // services.AddSyncaDistributed(); is already defined at the Startup.cs -> ConfigureServices
 public WeatherForecastController(ILogger <WeatherForecastController> logger,
                                  IDistributedCache memoryCache,
                                  IBackgroundTaskQueue queue)
 {
     _logger = logger;
     _cache  = memoryCache;
     _queue  = queue;
 }
コード例 #11
0
 public IPStackService(IIPServiceProvider iPServiceProvider, IBackgroundTaskQueue queue, IServiceScopeFactory serviceScopeFactory,
                       IJobProgressService jobProgressService)
 {
     _iPServiceProvider = iPServiceProvider;
     _jobService        = jobProgressService;
     Queue = queue;
     _serviceScopeFactory = serviceScopeFactory;
 }
コード例 #12
0
 public VerifyController(ILoggerFactory loggerFactory, IHubContext <ProgressHub> progressHubContext,
                         IBackgroundTaskQueue backgroundTaskQueue, WorkerService workerService)
 {
     this.loggerFactory       = loggerFactory;
     this.progressHubContext  = progressHubContext;
     this.backgroundTaskQueue = backgroundTaskQueue;
     this.workerService       = workerService;
 }
コード例 #13
0
        public HashesController(IHashesRepositoryPure repo, ILogger <HashesController> logger, IBackgroundTaskQueue backgroundTaskQueue)
        {
            _repo = repo;
            _repo.SetReadOnly(true);

            _logger = logger;
            _backgroundTaskQueue = backgroundTaskQueue;
        }
コード例 #14
0
 public QueuedHostedService(IQueuedConfig <QueuedHostedService> config,
                            IBackgroundTaskQueue taskQueue,
                            ILogger <QueuedHostedService> logger)
 {
     TaskQueue        = taskQueue;
     _logger          = logger;
     _concurrentTasks = config.ConcurrentTasks;
 }
コード例 #15
0
        public BulkUploadController(
            ILogger <BulkUploadController> logger,
            IBulkUploadService bulkUploadService,
            IBlobStorageService blobService,
            ICourseService courseService,
            IWebHostEnvironment env,
            IProviderService providerService,
            IBackgroundTaskQueue queue)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (bulkUploadService == null)
            {
                throw new ArgumentNullException(nameof(bulkUploadService));
            }

            if (blobService == null)
            {
                throw new ArgumentNullException(nameof(blobService));
            }

            if (courseService == null)
            {
                throw new ArgumentNullException(nameof(courseService));
            }

            if (env == null)
            {
                throw new ArgumentNullException(nameof(env));
            }

            if (courseService == null)
            {
                throw new ArgumentNullException(nameof(courseService));
            }

            if (providerService == null)
            {
                throw new ArgumentNullException(nameof(providerService));
            }

            if (queue == null)
            {
                throw new ArgumentNullException(nameof(queue));
            }

            _logger            = logger;
            _bulkUploadService = bulkUploadService;
            _blobService       = blobService;
            _courseService     = courseService;
            _env             = env;
            _courseService   = courseService;
            _providerService = providerService;
            _queue           = queue;
        }
コード例 #16
0
        public ServerInstance(string key, InstanceConfiguration instanceConfig, IConfiguration configuration,
                              ILogger <UpdateProviderJenkins> jenkinsLogger, ServersConfiguration serversConfiguration,
                              ILogger <ServerInstance> logger, IBackgroundTaskQueue taskQueue, ILogger <UpdateProviderLocal> localLogger,
                              ILogger <UpdateProviderGit> gitLogger)
        {
            Key                   = key;
            _instanceConfig       = instanceConfig;
            _configuration        = configuration;
            _serversConfiguration = serversConfiguration;
            _logger               = logger;
            _taskQueue            = taskQueue;

            switch (instanceConfig.UpdateType)
            {
            case "Jenkins":
                var jenkinsConfig = configuration
                                    .GetSection($"Servers:Instances:{key}:Updates")
                                    .Get <UpdateProviderJenkinsConfiguration>();

                _updateProvider = new UpdateProviderJenkins(jenkinsConfig, jenkinsLogger);
                break;

            case "Local":
                var localConfig = configuration
                                  .GetSection($"Servers:Instances:{key}:Updates")
                                  .Get <UpdateProviderLocalConfiguration>();

                _updateProvider = new UpdateProviderLocal(this, localConfig, localLogger, configuration);
                break;

            case "Git":
                var gitConfig = configuration
                                .GetSection($"Servers:Instances:{key}:Updates")
                                .Get <UpdateProviderGitConfiguration>();

                _updateProvider = new UpdateProviderGit(this, gitConfig, gitLogger, configuration);
                break;

            case "Dummy":
                _updateProvider = new UpdateProviderDummy();
                break;

            case null:
                _updateProvider = null;
                break;

            default:
                throw new ArgumentException($"Unknown update type: {instanceConfig.UpdateType}");
            }

            if (!Directory.Exists(InstanceDir))
            {
                Directory.CreateDirectory(InstanceDir);
                _logger.LogInformation($"Created InstanceDir {InstanceDir}");
            }

            LoadData();
        }
コード例 #17
0
ファイル: UsersService.cs プロジェクト: RamizJ/Workflow
 /// <summary>
 ///
 /// </summary>
 /// <param name="dataContext"></param>
 /// <param name="userManager"></param>
 /// <param name="entityStateQueue"></param>
 public UsersService(DataContext dataContext,
                     UserManager <ApplicationUser> userManager,
                     IBackgroundTaskQueue <VmEntityStateMessage> entityStateQueue)
 {
     _dataContext      = dataContext;
     _userManager      = userManager;
     _entityStateQueue = entityStateQueue;
     _vmConverter      = new VmUserConverter();
 }
コード例 #18
0
        public ConversionController(IBackgroundTaskQueue taskQueue, ConversionSettings settings, IConfiguration configuration, IHubContext <LogHub> logHub)
        {
            _logHub   = logHub;
            _settings = new Settings(settings, configuration);

            _settings.Load();
            _vocabulary = new Vocabulary(_settings, _logHub);
            _taskQueue  = taskQueue;
        }
コード例 #19
0
ファイル: MediaProcessHandler.cs プロジェクト: aurlaw/VueCore
 public MediaProcessHandler(ILogger<MediaProcessHandler> logger,
 IHubContext<MediaProcessHub, IMediaProcessHubClient> hubContext, 
 IBackgroundTaskQueue taskQueue, IMediaService mediaService)
 {
     _logger = logger;
     _hubClient = hubContext;
     _taskQueue = taskQueue;
     _mediaService = mediaService;
 }
 public ChartModel(IBackgroundTaskQueue queue,
                   IApplicationLifetime appLifetime,
                   ILogger <ChartModel> logger, IHubContext <MonitoramentoHub, ITypedHubClient> chatHubContex)
 {
     Queue           = queue;
     _appLifetime    = appLifetime;
     _logger         = logger;
     _chatHubContext = chatHubContex;
 }
コード例 #21
0
 public QueuedHostedService(
     IServiceProvider serviceProvider,
     IBackgroundTaskQueue taskQueue,
     ILogger <QueuedHostedService> logger)
 {
     TaskQueue        = taskQueue;
     _serviceProvider = serviceProvider;
     _logger          = logger;
 }
コード例 #22
0
 public AppSettingService(IBackgroundTaskQueue queue, ILoggerFactory loggerFactory,
                          IServiceScopeFactory serviceScopeFactory, IEmailService emailService, IEmailConfiguration emailConfiguration)
 {
     Queue                = queue;
     _emailService        = emailService;
     _logger              = loggerFactory.CreateLogger(typeof(AppSettingService));
     _serviceScopeFactory = serviceScopeFactory;
     _emailConfiguration  = emailConfiguration;
 }
コード例 #23
0
ファイル: QueuedHostedService.cs プロジェクト: gilads12/Stuff
 public QueuedHostedService(
     IServiceProvider services,
     IBackgroundTaskQueue taskQueue,
     ILoggerFactory loggerFactory)
 {
     _services = services;
     TaskQueue = taskQueue;
     _logger   = loggerFactory.CreateLogger <QueuedHostedService>();
 }
コード例 #24
0
 public BackgroundProductControllerWorker(ILogger <BackgroundProductControllerWorker> logger,
                                          IServiceProvider serviceProvider, IHubContext <ApiHub, IApiClient> productsHub,
                                          IBackgroundTaskQueue <ProductData> taskQueue)
 {
     _logger          = logger;
     _serviceProvider = serviceProvider;
     _productsHub     = productsHub;
     TaskQueue        = taskQueue;
 }
コード例 #25
0
ファイル: SceneController.cs プロジェクト: mchalejunior/ray
 public SceneController(IBackgroundTaskQueue taskQueue, IMediator mediator,
                        ILogger <SceneController> logger, IHostEnvironment env, IHostApplicationLifetime applicationLifetime)
 {
     _taskQueue           = taskQueue;
     _mediator            = mediator;
     _logger              = logger;
     _env                 = env;
     _applicationStopping = applicationLifetime.ApplicationStopping;
 }
コード例 #26
0
 public QueuedHostedService(IBackgroundTaskQueue taskQueue, IPublisher publisher)
 {
     TaskQueue              = taskQueue;
     this.publisher         = publisher;
     TaskQueue.QueueRelease = () =>
     {
         _signal.Release();
     };
 }
コード例 #27
0
ファイル: RaceLogic.cs プロジェクト: dubtar/VeloTiming-blazor
        public RaceLogic(IServiceProvider serviceProvider)
        {
            this.serviceProvider = serviceProvider;

            hub         = serviceProvider.GetService <IHubContext <ResultHub, IResultHub> >() ?? throw new Exception("Cannot resolve IResultHub");
            taskQueue   = serviceProvider.GetService <IBackgroundTaskQueue>() ?? throw new Exception("Cannot resolve IBackgroundTaskQueue");
            timeService = serviceProvider.GetService <ITimeService>() ?? throw new Exception("Cannot resolve ITimeService");
            _           = Init();
        }
コード例 #28
0
 public QueuedHostedService(
     IBackgroundTaskQueue queue,
     IServiceScopeFactory factory,
     ILoggerFactory loggerFactory)
 {
     _factory = factory ?? throw new ArgumentNullException(nameof(factory));
     _queue   = queue ?? throw new ArgumentNullException(nameof(queue));
     _logger  = loggerFactory.CreateLogger <QueuedHostedService>();
 }
コード例 #29
0
 public ValuablesRefresherScheduledTask
 (
     IConfiguration configuration,
     IBackgroundTaskQueue queue
 )
 {
     _configuration = configuration;
     _queue         = queue;
 }
コード例 #30
0
 public HomeController(
     IBackgroundTaskQueue taskQueue,
     ILogger <HomeController> logger,
     TorahVerses torahVerses)
 {
     _taskQueue   = taskQueue;
     _logger      = logger;
     _torahVerses = torahVerses;
 }
コード例 #31
0
        public BackgroundTaskExecutor(IBackgroundTaskQueue taskQueue)
        {
            if (taskQueue == null)
                throw new ArgumentNullException("taskQueue");

            _taskQueue = taskQueue;
            _taskQueue.Initialize();
            _initialized = true;
        }