splitclient-rb 5.0.0 → 5.0.1.pre.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c076154a02dec7e8890b5876ba070a1538538faa
4
- data.tar.gz: 6cb7288f737edc4ad4729dbe277e3e28cf02d349
3
+ metadata.gz: 426a3da581cf71876467709de4539d0a54ac8d64
4
+ data.tar.gz: b2ade7adc7395787ec88070f529f0c7e3fc2c6e5
5
5
  SHA512:
6
- metadata.gz: 3a115435291596586ef744571a7b16c2c23d799a732613f02f4536e68d78418ca1cd9d2d0c327d3bace028be05d0c80d2ceb342f029b99eb751f72437fb12c8d
7
- data.tar.gz: 31f9d3337cc4791fb5ba25629df7d47024ede9b16a7b85900d4206989449e23fcbfbc07d093e67d80a16f1cdb018f17068052f014144f2d204a9a0cbd32c4177
6
+ metadata.gz: 4ba37d45f83b4baf333feba68e1293629155edd6d0bd51b95c6610d8206580f3268843f57976d6d5b72dc554e5f476e1db886cd0cbe08f80ca797edc2263ccbd
7
+ data.tar.gz: 33a01ebc3bdd0cd833f01f2f6339a2455c1fd79283cf03ae0b1d0a6a2941eb73c77a58d955d97d59e581dd9f3a35f86cdf229ecc3967ede2455192054aa18994
@@ -1,3 +1,6 @@
1
+ 5.0.1 (July 19th, 2018)
2
+ - Adds stop! method to the factory for gracefully stopping the SDK.
3
+
1
4
  5.0.0 (May 18th, 2018)
2
5
  - Fix bug where the sdk picked the wrong hashing algo. This is a breaking change.
3
6
 
@@ -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, each thread has an infinite loop inside which is used to fetch splits/segments or send impressions/metrics.
451
- 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.
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're using Unicorn you'll need to include this line in your Unicorn config (probably `config/unicorn.rb`):
464
+ If youre using Unicorn youll 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
- Rails.configuration.split_factory.resume! if worker.nr > 0
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
- For those who use Puma in cluster mode add this to your Puma config (probably `config/puma.rb`):
480
+ If using Puma in cluster mode, add these lines to your Puma config (likely `config/puma.rb`):
474
481
 
475
482
  ```ruby
476
- on_worker_boot do |worker_number|
477
- Rails.configuration.split_factory.resume! if worker_number.nr > 0
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 that SDK will recreate threads for each new worker, besides master.
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
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '5.0.0'
2
+ VERSION = '5.0.1.pre.rc1'
3
3
  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.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-06-04 00:00:00.000000000 Z
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: '0'
318
+ version: 1.3.1
319
319
  requirements: []
320
320
  rubyforge_project:
321
- rubygems_version: 2.5.1
321
+ rubygems_version: 2.6.14
322
322
  signing_key:
323
323
  specification_version: 4
324
324
  summary: Ruby client for split SDK.