-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclient_store_options.go
53 lines (41 loc) · 1.07 KB
/
client_store_options.go
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
52
53
package wspubsub
import "time"
// ClientStoreOptions represents configuration of the storage.
type ClientStoreOptions struct {
ClientShards struct {
// Total number of shards
Count int
// Size of shard
Size int
// Size of a bucket in shard
BucketSize int
}
ChannelShards struct {
// Total number of shards
Count int
// Size of shard
Size int
// Size of a bucket in shard
BucketSize int
}
// Enable/disable debug mode.
IsDebug bool
// Function execution time limit in debug mode.
// Exceeding this time limit will cause a new warn log message.
DebugFuncTimeLimit time.Duration
}
// NewClientStoreOptions initializes a new ClientStoreOptions.
// nolint: gomnd
func NewClientStoreOptions() ClientStoreOptions {
options := ClientStoreOptions{
IsDebug: false,
DebugFuncTimeLimit: 1 * time.Millisecond,
}
options.ClientShards.Count = 128
options.ClientShards.Size = 10000
options.ChannelShards.BucketSize = 100
options.ChannelShards.Count = 16
options.ChannelShards.Size = 100
options.ChannelShards.BucketSize = 10000
return options
}