public HomeController(IAccessDashboardService objService, IPollingService pollingService, IPollingResultService pollingResultService) : base(objService) { _objService = objService; _pollingService = pollingService; _pollingResultService = pollingResultService; }
public PollingAdminController(IPollingService pollingService, IPollingAnswerService pollingAnswerService) : base(pollingService) { _pollingService = pollingService; AppId = (int)CategoryType.Undefined; ViewBag.AppId = AppId; _pollingAnswerService = pollingAnswerService; }
public PollingAdminController(IPollingService pollingService, int appId, IPollingAnswerService pollingAnswerService) : base(pollingService) { _pollingService = pollingService; AppId = appId; ViewBag.AppId = AppId; _pollingAnswerService = pollingAnswerService; }
public PollingApiController(IPollingService objService, IPollingResultService objResultService, IPollingResultTempService objResultTempService) : base(objService) { _objService = objService; _objResultService = objResultService; _objResultTempService = objResultTempService; }
public PollingController(IPollingService objService, IPollingResultService objResultService, IPollingResultTempService objResultTempService, IMeetingRoomRepairService objRepairService) : base(objService) { _objService = objService; _objResultService = objResultService; _objResultTempService = objResultTempService; _objRepairService = objRepairService; }
public PollingAdminController(IPollingService pollingService, int appId, IPollingAnswerService pollingAnswerService, IMeetingRoomRepairService objRepairService) : base(pollingService) { _pollingService = pollingService; AppId = appId; ViewBag.AppId = AppId; _pollingAnswerService = pollingAnswerService; _objRepairService = objRepairService; }
public MainPageViewModel(IEventAggregator ea, INavigationService ns, ISpotifyService ss, IPollingService ps) { _eventAggregator = ea; _eventAggregator.GetEvent <ReAuthEvent>().Subscribe(Authenticate); _navigationService = ns; _spotifyService = ss; _pollingService = ps; _pollingService.Span = TimeSpan.FromSeconds(POLLING_SPAN); _pollingService.Callback = GetSong; if (Preferences.Get("first_run", true) || !Preferences.Get("has_auth", false)) { Authenticate(); Preferences.Set("first_run", false); } else { _pollingService.Start(); } }
/// <summary> /// Executes a service /// </summary> /// <param name="pollingService">The service to run</param> /// <param name="token">Cancellation token</param> public static void Execute(IPollingService pollingService, CancellationToken token) { try { Thread.CurrentThread.TrySetName(pollingService.Name); while (!token.IsCancellationRequested) { log.Info(string.Format("Executing service {0}", pollingService.Name)); pollingService.Execute(); Thread.Sleep(pollingService.PollInterval); } log.Info(string.Format("Cancellation request found in {0} thread", Thread.CurrentThread.Name)); token.ThrowIfCancellationRequested(); } catch (Exception ex) { log.Info("Exception in Service thread"); log.Error(ex); } }
public void Configure(IWorkerApplicationBuilder app, IWorkerHostingEnvironment env, ILoggerFactory loggerFactory, IShutdownNotificationService shutdownService, IPollingService pollingService, ITimeoutService timeoutService) { shutdownService.OnShutdownNotification(async() => { // get a logger var logger = loggerFactory.CreateLogger("ShutdownHandler"); // delay logger.LogInformation("Delaying shutdown by 10 seconds"); await Task.Delay(5000); // done logger.LogInformation("Finished delay"); }); app.Use((WorkerApplicationOperation operation, IWorkerApplicationMiddlewareExecutionController next) => { // get a logger var logger = loggerFactory.CreateLogger("Processor"); // lookup a scoped service var scopedService = operation.Services.GetService <IScopedService>(); // log the message logger.LogInformation("MW01 - InstanceId: {0}", scopedService.InstanceId); return(next.Invoke()); }); app.Use((WorkerApplicationOperation operation, IWorkerApplicationMiddlewareExecutionController next) => { // get a logger var logger = loggerFactory.CreateLogger("Processor"); // lookup a scoped service var scopedService = operation.Services.GetService <IScopedService>(); // log the message logger.LogInformation("MW02 - InstanceId: {0}", scopedService.InstanceId); return(next.Invoke()); }); /*app.Use((WorkerApplicationOperation operation, IWorkerApplicationMiddlewareExecutionController next) => * { * // get a logger * var logger = loggerFactory.CreateLogger("AbortNextPolling"); * * logger.LogInformation("Abort..."); * pollingService.AbortDuringNextPolling(); * * return next.Invoke(); * });*/ app.Use(async(WorkerApplicationOperation operation, IWorkerApplicationMiddlewareExecutionController next) => { // get a logger var logger = loggerFactory.CreateLogger("Processor"); logger.LogInformation("Delaying Job"); // delay logger.LogInformation($"Delay 5sec - {DateTime.Now}"); await Task.Delay(5000); // reset the timeout await timeoutService.ResetExecutionTimeout(); // delay logger.LogInformation($"Delay 5sec - {DateTime.Now}"); await Task.Delay(5000); // reset the timeout await timeoutService.ResetExecutionTimeout(); // delay logger.LogInformation($"Delay 5sec - {DateTime.Now}"); await Task.Delay(5000); // reset the timeout await timeoutService.ResetExecutionTimeout(); // delay logger.LogInformation($"Delay 5sec - {DateTime.Now}"); await Task.Delay(5000); // delay logger.LogInformation($"Delay 5sec - {DateTime.Now}"); await Task.Delay(5000); // delay logger.LogInformation($"Delay 5sec - {DateTime.Now}"); await Task.Delay(5000); // next await next.Invoke(); }); app.UseOnTimeout(async(WorkerApplicationOperation operation) => { Console.WriteLine("Timeout Exceeded"); await Task.CompletedTask; // abort Console.WriteLine("Aborting Worker"); pollingService.AbortDuringNextPolling(); }); }
public PollingController(IPollingService pollingService) { _pollingService = pollingService; }
public PollsController(IPollingService polling) { _polling = polling; }