Example #1
0
        /// <summary>
        /// ctor.
        /// </summary>
        public SiteRootUrlMiddleware(RequestDelegate next, IThisApplication thisApplication)
        {
            thisApplication.CheckArgumentNull(nameof(thisApplication));

            _next            = next;
            _thisApplication = thisApplication;
        }
Example #2
0
        /// <summary>
        /// Scheduled Tasks Manager
        /// </summary>
        public ScheduledTasksCoordinator(
            ILogger <ScheduledTasksCoordinator> logger,
            IApplicationLifetime applicationLifetime,
            IOptions <ScheduledTasksStorage> tasksStorage,
            IJobsRunnerTimer jobsRunnerTimer,
            IThisApplication thisApplication,
            IServiceProvider serviceProvider)
        {
            logger.CheckArgumentNull(nameof(logger));
            applicationLifetime.CheckArgumentNull(nameof(applicationLifetime));
            tasksStorage.CheckArgumentNull(nameof(tasksStorage));
            jobsRunnerTimer.CheckArgumentNull(nameof(jobsRunnerTimer));
            thisApplication.CheckArgumentNull(nameof(thisApplication));
            serviceProvider.CheckArgumentNull(nameof(serviceProvider));

            _logger          = logger;
            _tasksStorage    = tasksStorage;
            _jobsRunnerTimer = jobsRunnerTimer;
            _thisApplication = thisApplication;
            _serviceProvider = serviceProvider;
            applicationLifetime.ApplicationStopping.Register(() =>
            {
                _logger.LogInformation("Application is stopping ... .");
                disposeResources().Wait();
            });
        }
Example #3
0
 /// <summary>
 /// DNTScheduler needs a ping service to keep it alive.
 /// </summary>
 public PingTask(IThisApplication thisApplication)
 {
     _thisApplication = thisApplication;
 }