/// <summary> /// Use SQL Server as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm. /// </summary> /// <param name="resolver">The dependency resolver.</param> /// <param name="configuration">The SQL scale-out configuration options.</param> /// <returns>The dependency resolver.</returns> public static IDependencyResolver UseSqlServer(this IDependencyResolver resolver, SqlScaleoutConfiguration configuration) { if (resolver == null) { throw new ArgumentNullException("resolver"); } var bus = new Lazy<SqlMessageBus>(() => new SqlMessageBus(resolver, configuration)); resolver.Register(typeof(IMessageBus), () => bus.Value); return resolver; }
/// <summary> /// Use SQL Server as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm. /// </summary> /// <param name="resolver">The dependency resolver.</param> /// <param name="configuration">The SQL scale-out configuration options.</param> /// <returns>The dependency resolver.</returns> public static IDependencyResolver UseSqlServer(this IDependencyResolver resolver, SqlScaleoutConfiguration configuration) { if (resolver == null) { throw new ArgumentNullException("resolver"); } // TODO: Can this be Lazy<T> initialized again now? var bus = new SqlMessageBus(resolver, configuration); resolver.Register(typeof(IMessageBus), () => bus); return resolver; }
public void Configuration(IAppBuilder app) { var connectionString = @"Data Source=(localdb)\v11.0;Initial Catalog=SignalRBroadcastDb;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False"; /* Example of connection string: @"server=.\SQLExpress;database=signalrscaleout;Trusted_Connection=yes"; */ var config = new SqlScaleoutConfiguration(connectionString) { TableCount = 5 }; GlobalHost.DependencyResolver.UseSqlServer(config); app.MapSignalR(); }
/// <summary> /// Use SQL Server as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm. /// </summary> /// <param name="resolver">The dependency resolver.</param> /// <param name="connectionString">The SQL Server connection string.</param> /// <returns>The dependency resolver.</returns> public static IDependencyResolver UseSqlServer(this IDependencyResolver resolver, string connectionString) { var config = new SqlScaleoutConfiguration(connectionString); return UseSqlServer(resolver, config); }
/// <summary> /// Use SQL Server as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm. /// </summary> /// <param name="resolver">The dependency resolver.</param> /// <param name="configuration">The SQL scale-out configuration options.</param> /// <returns>The dependency resolver.</returns> public static IDependencyResolver UseSqlServer(this IDependencyResolver resolver, SqlScaleoutConfiguration configuration) { if (resolver == null) { throw new ArgumentNullException("resolver"); } var bus = new Lazy <SqlMessageBus>(() => new SqlMessageBus(resolver, configuration)); resolver.Register(typeof(IMessageBus), () => bus.Value); return(resolver); }
/// <summary> /// Use SQL Server as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm. /// </summary> /// <param name="resolver">The dependency resolver.</param> /// <param name="connectionString">The SQL Server connection string.</param> /// <returns>The dependency resolver.</returns> public static IDependencyResolver UseSqlServer(this IDependencyResolver resolver, string connectionString) { var config = new SqlScaleoutConfiguration(connectionString); return(UseSqlServer(resolver, config)); }
/// <summary> /// Use SQL Server as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm. /// </summary> /// <param name="resolver">The dependency resolver.</param> /// <param name="configuration">The SQL scale-out configuration options.</param> /// <returns>The dependency resolver.</returns> public static IDependencyResolver UseSqlServer(this IDependencyResolver resolver, SqlScaleoutConfiguration configuration) { if (resolver == null) { throw new ArgumentNullException("resolver"); } // TODO: Can this be Lazy<T> initialized again now? var bus = new SqlMessageBus(resolver, configuration); resolver.Register(typeof(IMessageBus), () => bus); return(resolver); }