forked from SignalR/SignalR
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SqlScaleoutConfiguration.cs
51 lines (45 loc) · 1.49 KB
/
SqlScaleoutConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System;
using Microsoft.AspNet.SignalR.Messaging;
namespace Microsoft.AspNet.SignalR
{
/// <summary>
/// Settings for the SQL Server scale-out message bus implementation.
/// </summary>
public class SqlScaleoutConfiguration : ScaleoutConfiguration
{
private int _tableCount = 1;
public SqlScaleoutConfiguration(string connectionString)
{
if (String.IsNullOrEmpty(connectionString))
{
throw new ArgumentNullException("connectionString");
}
ConnectionString = connectionString;
}
/// <summary>
/// The SQL Server connection string to use.
/// </summary>
public string ConnectionString { get; private set; }
/// <summary>
/// The number of tables to store messages in. Using more tables reduces lock contention and may increase throughput.
/// This must be consistent between all nodes in the web farm.
/// Defaults to 1.
/// </summary>
public int TableCount
{
get
{
return _tableCount;
}
set
{
if (value < 1)
{
throw new ArgumentOutOfRangeException("value");
}
_tableCount = value;
}
}
}
}