// Singletons are lazy instantiation.. so if we don't ask for an instance during startup, // they'll never get used. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IEventProcessor eventProcessor, IOptions <PubnubOptions> pubnubOptions, IRealtimePublisher realtimePublisher) { realtimePublisher.Validate(); realtimePublisher.Publish(pubnubOptions.Value.StartupChannel, "{'hello': 'world'}"); eventProcessor.Start(); app.UseMvc(); }
// Singletons are lazy instantiation.. so if we don't ask for an instance during startup, // they'll never get used. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IEventProcessor eventProcessor, IOptions <PubnubOptions> pubnubOptions, IRealtimePublisher realtimePublisher) { realtimePublisher.Validate(); realtimePublisher.Publish(pubnubOptions.Value.StartupChannel, "{'hello': 'world'}"); eventProcessor.Start(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapControllerRoute( name: "default", pattern: "{controller}/{action}/{id?}" ); }); }