/* * consumer stub throughput ratings 10000 at 940 ms. tp 1 at ,09ms :: internal module throughput (same appdomain) 10000 at 3722 ms. tp 1 at ,37 :: external module throughput (cross appdomain) * */ public Broker(RestartApplication restartApp = null, RestartApplication resetBroker = null) { this.restartApp = restartApp; this.resetBroker = resetBroker; logger.Debug("intitialising broker"); // logger for modules only ModulesLogger = new TaskBroker.Logger.CommonTape(new Logger.LoggerEndpoint[]{ new Logger.ConsoleEndpoint() }); ClearConfiguration(); Statistics = new StatHub(); Scheduler = new TaskScheduler.ThreadPool(); AssemblyHolder = new Assemblys.AssemblyPackages(); MaintenanceTasks = new List<PlanItem>() { // include statistic flush task new PlanItem(){ intervalType = IntervalType.intervalSeconds, intervalValue = 15, NameAndDescription="statistic maintenance task", JobEntry = (ThreadContext ti, PlanItem pi)=>{ Statistics.FlushRetairedChunks(); return 1; } }, // //new PlanItem(){ // intervalType = IntervalType.intervalSeconds, // intervalValue = 30, // NameAndDescription="assemblies maintenance task", // JobEntry = (ThreadContext ti, PlanItem pi)=> // { // AssemblyHolder.assemblySources.FetchAllIfRequired(); // AssemblyHolder.assemblySources.BuildAllIfRequired(); // AssemblyHolder.assemblySources.UpdateAllIfRequired(); // } //} // TODO: // performance tune // by channel level growing -> increment tasks for channel -> increment working threads // check for throughput if doesn't change -> rollback to default execution plan //new PlanItem(){ // intervalType = IntervalType.intervalSeconds, // intervalValue = 10, // NameAndDescription="channel throughput tune", // planEntry = (ThreadItem ti, PlanItem pi)=>{ } //} // with 10sec interval->update quilifier // with 30sec with quilifier data do recommendations from recommedationsHub }; Modules = new ModHolder(this); QueueInterfaces = new QueueClassificator(); Configurations = new ConfigurationDepot(); }
/// <summary> /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> public void Post(RestartApplication request) { Task.Run(async() => { await Task.Delay(100); _appHost.Restart(); }); }
/// <summary> /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> public void Post(RestartApplication request) { Task.Run(async() => { await Task.Delay(100).ConfigureAwait(false); await _appHost.Restart().ConfigureAwait(false); }); }
/// <summary> /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> public void Post(RestartApplication request) { _appHost.Restart(); }