public CommunityService(ICommunityRepository repository, IUnitOfWork unitOfWork, IConcurrencyProcessor concurrencyProcessor, IMailboxProcessor mailboxProcessor) { _repository = repository; _unitOfWork = unitOfWork; _concurrencyProcessor = concurrencyProcessor; _mailboxProcessor = mailboxProcessor; }
// Token: 0x0600157F RID: 5503 RVA: 0x0007A4C0 File Offset: 0x000786C0 private void RefreshRegisteredMailboxProcessors() { this.mailboxProcessors.Clear(); this.mailboxProcessorStartWorkcycleActions = null; this.mailboxProcessorStopWorkcycleActions = null; foreach (MailboxProcessorAssistant.MailboxProcessorConstructor mailboxProcessorConstructor in this.mailboxProcessorConstructors.GetInvocationList()) { IMailboxProcessor mailboxProcessor = mailboxProcessorConstructor(); this.EnableMailboxProcessor(mailboxProcessor); this.mailboxProcessors.Add(mailboxProcessor); } MailboxProcessorAssistantType.TraceInformation((long)this.GetHashCode(), "{0} of actual mailbox processors were instantiated for the current workcycle.", new object[] { this.mailboxProcessors.Count }); }
public HomeController(IConcurrencyProcessor concurrencyProcessor, ILogger <HomeController> logger, IObjectProvider objectProvider, IUnitOfWork unitOfWork, ICommunityRepository domainRepository, SampleModelContext dbContext, ICommunityService communityService, IMailboxProcessor mailboxProcessor) { _concurrencyProcessor = concurrencyProcessor; _objectProvider = objectProvider; _unitOfWork = unitOfWork; _domainRepository = domainRepository; _dbContext = dbContext; _communityService = communityService; _mailboxProcessor = mailboxProcessor; _logger = logger; }
// Token: 0x06001581 RID: 5505 RVA: 0x0007A608 File Offset: 0x00078808 private void DisableMailboxProcessor(IMailboxProcessor processor) { if (!processor.IsEnabled) { MailboxProcessorAssistantType.TraceInformation((long)this.GetHashCode(), "Mailbox processor of type {0} already disabled for current workcycle.", new object[] { processor.GetType().ToString() }); return; } processor.IsEnabled = false; this.mailboxProcessorStartWorkcycleActions = (MailboxProcessorAssistant.MailboxProcessorOnStartStopAction)Delegate.Remove(this.mailboxProcessorStartWorkcycleActions, new MailboxProcessorAssistant.MailboxProcessorOnStartStopAction(processor.OnStartWorkcycle)); this.mailboxProcessorStopWorkcycleActions = (MailboxProcessorAssistant.MailboxProcessorOnStartStopAction)Delegate.Remove(this.mailboxProcessorStopWorkcycleActions, new MailboxProcessorAssistant.MailboxProcessorOnStartStopAction(processor.OnStopWorkcycle)); MailboxProcessorAssistantType.TraceInformation((long)this.GetHashCode(), "Mailbox processor of type {0} was disabled for current workcycle.", new object[] { processor.GetType().ToString() }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMessageTypeProvider messageTypeProvider, IOptions <FrameworkConfiguration> frameworkConfigOptions, IMailboxProcessor mailboxProcessor, IApplicationLifetime applicationLifetime) { applicationLifetime.ApplicationStopping.Register(() => { _commandConsumer1?.Stop(); _commandConsumer2?.Stop(); _commandConsumer3?.Stop(); _domainEventProcessor?.Stop(); _applicationEventProcessor?.Stop(); _messagePublisher?.Stop(); _commandBus?.Stop(); mailboxProcessor.Stop(); }); mailboxProcessor.Start(); messageTypeProvider.Register(new Dictionary <string, string> { ["Login"] = "******" }) .Register("Modify", typeof(Modify)); StartMessageQueueComponents(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler(new GlobalExceptionHandlerOptions(loggerFactory, env)); } //app.UseMiniProfiler(); PathBase = Configuration.Instance[nameof(PathBase)]; app.UsePathBase(PathBase); app.Use(next => context => { context.Request.Path = context.Request.Path.Value.Replace("//", "/"); return(next(context)); }); app.Use(next => context => { context.Request.EnableRewind(); context.Response.EnableRewind(); return(next(context)); }); //app.Use(async (context, next) => //{ // await next(); // if (context.Response.StatusCode == StatusCodes.Status404NotFound) // { // context.Request.Path = "/Home/Error"; // await next(); // } //}); app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}"); }); app.UseLogLevelController(); app.UseMessageProcessorDashboardMiddleware(); var logger = loggerFactory.CreateLogger <Startup>(); logger.SetMinLevel(LogLevel.Information); logger.LogInformation($"Startup configured env: {env.EnvironmentName}"); }