namespace Atomx.Admin.Extensions
{
    public static class SignalRExtension
    {
        /// <summary>
        /// 添加身份验证服务
        /// </summary>
        /// <param name="services"></param>
        /// <param name="Configuration"></param>
        public static void AddSignalR(this IServiceCollection services, IConfiguration Configuration, IWebHostEnvironment environment)
        {
            // SignalR
            //services.AddSignalR(options =>
            //{
            //    options.EnableDetailedErrors = environment.IsDevelopment();
            //    options.ClientTimeoutInterval = TimeSpan.FromSeconds(30);
            //    options.HandshakeTimeout = TimeSpan.FromSeconds(15);
            //    options.KeepAliveInterval = TimeSpan.FromSeconds(10);
            //    options.MaximumReceiveMessageSize = 1024 * 1024; // 1MB

            //    if (!environment.IsDevelopment())
            //    {
            //        options.StreamBufferCapacity = 10;
            //    }
            //})
            //.AddMessagePackProtocol()
            //.AddStackExchangeRedis(redisConnectionString, options =>
            //{
            //    options.Configuration.ChannelPrefix = "BlazorAuthApp:SignalR";
            //});
        }
    }
}
