mixed_gauge 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +10 -2
- data/lib/mixed_gauge/cluster_config.rb +4 -3
- data/lib/mixed_gauge/routing.rb +1 -1
- data/lib/mixed_gauge/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe193d3c4bbc6e42d5c285a7fc0db71b0d9fd63e
|
4
|
+
data.tar.gz: 135ac4476a0fb604f1c073853a1cef51fc8602d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3d30a1b8a4a637405393025144dfb8bfe450bb46bc01e37012c593d8ef5e97807bc2f18e7ebf690ea872ae5ad40eb74ea174bbea404e67a6b5e1eacc9db8c8f
|
7
|
+
data.tar.gz: 5b30aa9199b3d09a22e12c305c1b063a572843606422221c61efa62674df5d21f61d384d4b93be409eae3e9b8dd3310d7b4169658cf21902f1cd6aea75211f83
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -138,8 +138,10 @@ access_token.token #=> a generated token
|
|
138
138
|
|
139
139
|
## Advanced configuration
|
140
140
|
### Hash fucntion
|
141
|
-
|
142
|
-
|
141
|
+
Default hash fucntion is CRC32, which has better perfomance for this kind of
|
142
|
+
usecase.
|
143
|
+
|
144
|
+
But you can use arbitrary hash function like:
|
143
145
|
|
144
146
|
```ruby
|
145
147
|
# gem install fnv
|
@@ -151,6 +153,12 @@ Mixedgauge.configure do |config|
|
|
151
153
|
end
|
152
154
|
```
|
153
155
|
|
156
|
+
Suggested hash functions are:
|
157
|
+
|
158
|
+
- MurmurHash
|
159
|
+
- FNV Hash
|
160
|
+
- SuperFastHash
|
161
|
+
|
154
162
|
## Installation
|
155
163
|
|
156
164
|
Add this line to your application's Gemfile:
|
@@ -9,7 +9,7 @@ module MixedGauge
|
|
9
9
|
@connection_registry = {}
|
10
10
|
end
|
11
11
|
|
12
|
-
# @param [Range] slots
|
12
|
+
# @param [Range] slots Range consisted with Fixnum.
|
13
13
|
def define_slots(slots)
|
14
14
|
@slots = slots
|
15
15
|
end
|
@@ -22,11 +22,12 @@ module MixedGauge
|
|
22
22
|
|
23
23
|
def validate_config!
|
24
24
|
# TODO
|
25
|
+
# validate non Fixnum slots.
|
25
26
|
end
|
26
27
|
|
27
28
|
# @return [Integer]
|
28
|
-
def
|
29
|
-
@slots.
|
29
|
+
def slot_size
|
30
|
+
@slots.size
|
30
31
|
end
|
31
32
|
|
32
33
|
# @param [Integer] slot
|
data/lib/mixed_gauge/routing.rb
CHANGED
data/lib/mixed_gauge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixed_gauge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taiki Ono
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|