mixed_gauge 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/mixed_gauge.rb +1 -0
- data/lib/mixed_gauge/cluster_config.rb +0 -4
- data/lib/mixed_gauge/config.rb +4 -3
- data/lib/mixed_gauge/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 710c53d91da41c8135d1fe2b2a0d2a90c5af4ffb
|
4
|
+
data.tar.gz: 29123eafebf6b4056bdbe40eb6dfa207abbb89b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5db5f80874c5e47b0da03c4929cbaec2a77fb7327fb2de0463437e2c5004e651a4a1d95a363f1e708a81a0579880602920d6399c5a08e74e41b0fe495d09f84c
|
7
|
+
data.tar.gz: 5c1160538e29b86d50efd84e76cb8bfe6781ada302c7ca2c7de55e29873f2e3d91661f33bef542d8b27ba632eeca2f4065d44deb058331c45cd58f7909c820f2
|
data/CHANGELOG.md
CHANGED
data/lib/mixed_gauge.rb
CHANGED
@@ -10,18 +10,14 @@ module MixedGauge
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# @param [Range] slots
|
13
|
-
# @return [nil]
|
14
13
|
def define_slots(slots)
|
15
14
|
@slots = slots
|
16
|
-
nil
|
17
15
|
end
|
18
16
|
|
19
17
|
# @param [Range] slots
|
20
18
|
# @param [Symbol] connection connection name
|
21
|
-
# @return [nil]
|
22
19
|
def register(slots, connection)
|
23
20
|
@connection_registry[slots] = connection
|
24
|
-
nil
|
25
21
|
end
|
26
22
|
|
27
23
|
def validate_config!
|
data/lib/mixed_gauge/config.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
require 'zlib'
|
2
|
+
|
1
3
|
module MixedGauge
|
2
4
|
class Config
|
3
|
-
DEFAULT_HASH_FUNCTION = -> (key) {
|
5
|
+
DEFAULT_HASH_FUNCTION = -> (key) { Zlib.crc32(key) }
|
4
6
|
|
5
7
|
attr_reader :hash_proc, :cluster_configs
|
6
8
|
|
@@ -11,7 +13,7 @@ module MixedGauge
|
|
11
13
|
|
12
14
|
# Define config for specific cluster.
|
13
15
|
# @param [Symbol] cluster_name
|
14
|
-
# @
|
16
|
+
# @yield [MixedGauge::ClusterConfig]
|
15
17
|
# @example
|
16
18
|
# config.define_cluster(:user) do |cluster|
|
17
19
|
# cluster.define_slots(1..1048576)
|
@@ -22,7 +24,6 @@ module MixedGauge
|
|
22
24
|
cluster_config = ClusterConfig.new(cluster_name)
|
23
25
|
cluster_config.instance_eval(&block)
|
24
26
|
@cluster_configs[cluster_name] = cluster_config
|
25
|
-
nil
|
26
27
|
end
|
27
28
|
|
28
29
|
# @param [Symbol] cluster_name
|
data/lib/mixed_gauge/version.rb
CHANGED