We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some thoughts on graceful shutdown, either for app pool recycle or server reboot. Event can fire to notify clients.
public void ConfigureServices(IServiceCollection services) { services.AddSignalR(); services.AddSingleton<IApplicationLifetime>(provider => { var lifetime = provider.GetService<IHostApplicationLifetime>(); return lifetime; }); }
then
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApplicationLifetime lifetime) { app.UseEndpoints(endpoints => { endpoints.MapHub<DashboardHub>("/dashboardHub", options => { options.AddHubOptions<DashboardHub>(o => { o.AddClient lifetime); }); }); }); }
public class DashboardHub: Hub { private readonly IApplicationLifetime _lifetime; private static CAD _cad; public DashboardHub(IApplicationLifetime lifetime, CAD cad) { _lifetime = lifetime; _lifetime.ApplicationStopping.Register(OnStopping); _cad = cad; } private void OnStopping() { // Code to handle the shutdown goes here } }
There may be better ways to handle this.
The text was updated successfully, but these errors were encountered:
Actually - IApplicationLifetype is obsolete; use IHostApplicationLifetime instead.
Sorry, something went wrong.
When branches are created from issues, their pull requests are automatically linked.
Some thoughts on graceful shutdown, either for app pool recycle or server reboot. Event can fire to notify clients.
then
then
There may be better ways to handle this.
The text was updated successfully, but these errors were encountered: