splitclient-rb 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.txt +3 -0
- data/Detailed-README.md +23 -4
- data/lib/splitclient-rb/engine/matchers/matches_string_matcher.rb +2 -7
- data/lib/splitclient-rb/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: 74a4925604de05a5e5d9422be5f62b1ec8d66a07
|
4
|
+
data.tar.gz: 879a2f9cad369b6dd0f52d6f23f5ebf6fd514475
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98e87182688107a90fefd26ac3d7d108ba09a99024afd0f3a3620b2fe1f64fabc917da6f1a54d71f5af560c680f1321ae0516ed26d4643e5daa7291ecf41f482
|
7
|
+
data.tar.gz: 24af1504410b5075632ffc8e06d1fa2704218438bb91375f01a45d5b564be73ecf44bd66a6ad3cbfb96d8913f53e0b04b5d285fc794396b89e5c223e7f8e28e8
|
data/CHANGES.txt
CHANGED
data/Detailed-README.md
CHANGED
@@ -424,9 +424,20 @@ Currently SDK supports:
|
|
424
424
|
|
425
425
|
Other servers should work fine as well, but haven't been tested.
|
426
426
|
|
427
|
-
### Unicorn
|
427
|
+
### Unicorn and Puma in cluster mode (only for "memory mode")
|
428
428
|
|
429
|
-
|
429
|
+
During the start of your application SDK spawns multiple threads, each thread has an infinite loop inside which is used to fetch splits/segments or send impressions/metrics.
|
430
|
+
Several servers like Unicorn and Puma in cluster mode (i.e. with `workers` > 0) spawn multiple child processes, but when child process is spawn it does not recreate threads, which existed in the parent process, that's why if you use Unicorn or Puma in cluster mode you need to make two small extra steps.
|
431
|
+
|
432
|
+
For both servers you will need to have the following line in your `config/initializers/splitclient.rb`:
|
433
|
+
|
434
|
+
```ruby
|
435
|
+
Rails.configuration.split_factory = factory
|
436
|
+
```
|
437
|
+
|
438
|
+
#### Unicorn
|
439
|
+
|
440
|
+
If you're using Unicorn you'll need to include this line in your Unicorn config (probably `config/unicorn.rb`):
|
430
441
|
|
431
442
|
```ruby
|
432
443
|
after_fork do |server, worker|
|
@@ -434,12 +445,20 @@ after_fork do |server, worker|
|
|
434
445
|
end
|
435
446
|
```
|
436
447
|
|
437
|
-
|
448
|
+
By doing that SDK will recreate threads for each new worker, besides master.
|
449
|
+
|
450
|
+
#### Puma
|
451
|
+
|
452
|
+
For those who use Puma in cluster mode add this to your Puma config (probably `config/puma.rb`):
|
438
453
|
|
439
454
|
```ruby
|
440
|
-
|
455
|
+
on_worker_boot do |worker_number|
|
456
|
+
Rails.configuration.split_factory.resume! if worker_number.nr > 0
|
457
|
+
end
|
441
458
|
```
|
442
459
|
|
460
|
+
By doing that SDK will recreate threads for each new worker, besides master.
|
461
|
+
|
443
462
|
## Framework support
|
444
463
|
|
445
464
|
Currently SDK supports:
|
@@ -6,18 +6,13 @@ module SplitIoClient
|
|
6
6
|
|
7
7
|
def initialize(attribute, regexp_string)
|
8
8
|
@attribute = attribute
|
9
|
-
@regexp_string = regexp_string
|
9
|
+
@regexp_string = @regexp_string.is_a?(Regexp) ? regexp_string : Regexp.new(regexp_string)
|
10
10
|
end
|
11
11
|
|
12
12
|
def match?(_matching_key, _bucketing_key, _evaluator, data)
|
13
13
|
value = data.fetch(@attribute) { |attr| data[attr.to_s] || data[attr.to_sym] }
|
14
14
|
|
15
|
-
|
16
|
-
(value =~ @regexp_string) != nil
|
17
|
-
else
|
18
|
-
# String here
|
19
|
-
value == @regexp_string
|
20
|
-
end
|
15
|
+
(value =~ @regexp_string) != nil
|
21
16
|
end
|
22
17
|
end
|
23
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: splitclient-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Split Software
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|