splitclient-rb 5.0.0 → 5.0.1.pre.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.txt +3 -0
- data/Detailed-README.md +23 -10
- data/NEWS +5 -0
- data/README.md +1 -0
- data/lib/splitclient-rb/split_factory.rb +4 -0
- data/lib/splitclient-rb/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 426a3da581cf71876467709de4539d0a54ac8d64
|
4
|
+
data.tar.gz: b2ade7adc7395787ec88070f529f0c7e3fc2c6e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ba37d45f83b4baf333feba68e1293629155edd6d0bd51b95c6610d8206580f3268843f57976d6d5b72dc554e5f476e1db886cd0cbe08f80ca797edc2263ccbd
|
7
|
+
data.tar.gz: 33a01ebc3bdd0cd833f01f2f6339a2455c1fd79283cf03ae0b1d0a6a2941eb73c77a58d955d97d59e581dd9f3a35f86cdf229ecc3967ede2455192054aa18994
|
data/CHANGES.txt
CHANGED
data/Detailed-README.md
CHANGED
@@ -447,8 +447,11 @@ Other servers should work fine as well, but haven't been tested.
|
|
447
447
|
|
448
448
|
### Unicorn and Puma in cluster mode (only for "memory mode")
|
449
449
|
|
450
|
-
During the start of your application SDK spawns multiple threads
|
451
|
-
|
450
|
+
During the start of your application, the SDK spawns multiple threads. Each thread has an infinite loop inside,
|
451
|
+
which is used to fetch splits/segments or send impressions/metrics to the Split service continuously.
|
452
|
+
When using Unicorn or Puma in cluster mode (i.e. with `workers` > 0) the application
|
453
|
+
server will spawn multiple child processes, but they won't recreate the threads that existed in the parent process.
|
454
|
+
So, if your application is running in Unicorn or Puma in cluster mode you need to make two small extra steps.
|
452
455
|
|
453
456
|
For both servers you will need to have the following line in your `config/initializers/splitclient.rb`:
|
454
457
|
|
@@ -458,27 +461,37 @@ Rails.configuration.split_factory = factory
|
|
458
461
|
|
459
462
|
#### Unicorn
|
460
463
|
|
461
|
-
If you
|
464
|
+
If you’re using Unicorn you’ll need to include these lines in your Unicorn config (likely `config/unicorn.rb`):
|
462
465
|
|
463
466
|
```ruby
|
467
|
+
before_fork do |server, worker|
|
468
|
+
# keep your existing before_fork code if any
|
469
|
+
Rails.configuration.split_factory.stop!
|
470
|
+
end
|
471
|
+
|
464
472
|
after_fork do |server, worker|
|
465
|
-
|
473
|
+
# keep your existing after_fork code if any
|
474
|
+
Rails.configuration.split_factory.resume!
|
466
475
|
end
|
467
476
|
```
|
468
477
|
|
469
|
-
By doing that SDK will recreate threads for each new worker, besides master.
|
470
|
-
|
471
478
|
#### Puma
|
472
479
|
|
473
|
-
|
480
|
+
If using Puma in cluster mode, add these lines to your Puma config (likely `config/puma.rb`):
|
474
481
|
|
475
482
|
```ruby
|
476
|
-
|
477
|
-
|
483
|
+
before_fork do
|
484
|
+
# keep your existing before_fork code if any
|
485
|
+
Rails.configuration.split_factory.stop!
|
486
|
+
end
|
487
|
+
|
488
|
+
on_worker_boot do
|
489
|
+
# keep your existing on_worker_boot code if any
|
490
|
+
Rails.configuration.split_factory.resume!
|
478
491
|
end
|
479
492
|
```
|
480
493
|
|
481
|
-
By doing
|
494
|
+
By doing the above, the SDK will recreate the threads for each new worker and prevent the master process (that doesn't handle requests) from needlessly querying the Split service.
|
482
495
|
|
483
496
|
## Proxy support
|
484
497
|
|
data/NEWS
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
5.0.1
|
2
|
+
|
3
|
+
Adding stop! method to the factory.
|
4
|
+
With this method the user will be able to stop the threads that queries the Split Service. This will be used in the before_fork configuration in Puma and Unicorn to stop the threads in the master process.
|
5
|
+
|
1
6
|
5.0.0
|
2
7
|
|
3
8
|
This is a breaking change in how users buckets are allocated.
|
data/README.md
CHANGED
@@ -31,6 +31,7 @@ Split has built and maintains a SDKs for:
|
|
31
31
|
* Python [Github](https://github.com/splitio/python-client) [Docs](http://docs.split.io/docs/python-sdk-overview)
|
32
32
|
* GO [Github](https://github.com/splitio/go-client) [Docs](http://docs.split.io/docs/go-sdk-overview)
|
33
33
|
* Android [Github](https://github.com/splitio/android-client) [Docs](https://docs.split.io/v1/docs/android-sdk-overview)
|
34
|
+
* IOS [Github](https://github.com/splitio/ios-client) [Docs](https://docs.split.io/v1/docs/ios-sdk-overview)
|
34
35
|
|
35
36
|
For a comprehensive list of opensource projects visit our [Github page](https://github.com/splitio?utf8=%E2%9C%93&query=%20only%3Apublic%20).
|
36
37
|
|
@@ -30,6 +30,10 @@ module SplitIoClient
|
|
30
30
|
SplitAdapter.new(@api_key, @config, @splits_repository, @segments_repository, @impressions_repository, @metrics_repository, @events_repository, @sdk_blocker)
|
31
31
|
end
|
32
32
|
|
33
|
+
def stop!
|
34
|
+
@config.threads.each { |_, t| t.exit }
|
35
|
+
end
|
36
|
+
|
33
37
|
alias resume! start!
|
34
38
|
end
|
35
39
|
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: 5.0.
|
4
|
+
version: 5.0.1.pre.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Split Software
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -313,12 +313,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
313
313
|
version: '0'
|
314
314
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
315
315
|
requirements:
|
316
|
-
- - "
|
316
|
+
- - ">"
|
317
317
|
- !ruby/object:Gem::Version
|
318
|
-
version:
|
318
|
+
version: 1.3.1
|
319
319
|
requirements: []
|
320
320
|
rubyforge_project:
|
321
|
-
rubygems_version: 2.
|
321
|
+
rubygems_version: 2.6.14
|
322
322
|
signing_key:
|
323
323
|
specification_version: 4
|
324
324
|
summary: Ruby client for split SDK.
|