splitclient-rb 7.3.0.pre.rc2-java → 7.3.2-java
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/.github/workflows/ci.yml +78 -0
- data/.rubocop.yml +3 -0
- data/CHANGES.txt +11 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/splitclient-rb/cache/fetchers/segment_fetcher.rb +10 -13
- data/lib/splitclient-rb/cache/fetchers/split_fetcher.rb +7 -9
- data/lib/splitclient-rb/cache/stores/localhost_split_store.rb +3 -6
- data/lib/splitclient-rb/clients/split_client.rb +5 -5
- data/lib/splitclient-rb/engine/api/segments.rb +8 -4
- data/lib/splitclient-rb/engine/api/splits.rb +5 -3
- data/lib/splitclient-rb/engine/back_off.rb +26 -0
- data/lib/splitclient-rb/engine/common/impressions_manager.rb +4 -4
- data/lib/splitclient-rb/engine/push_manager.rb +1 -1
- data/lib/splitclient-rb/engine/status_manager.rb +33 -0
- data/lib/splitclient-rb/engine/sync_manager.rb +27 -48
- data/lib/splitclient-rb/engine/synchronizer.rb +124 -14
- data/lib/splitclient-rb/managers/split_manager.rb +4 -4
- data/lib/splitclient-rb/split_config.rb +14 -0
- data/lib/splitclient-rb/split_factory.rb +27 -23
- data/lib/splitclient-rb/sse/event_source/client.rb +3 -2
- data/lib/splitclient-rb/sse/workers/segments_worker.rb +1 -5
- data/lib/splitclient-rb/sse/workers/splits_worker.rb +1 -8
- data/lib/splitclient-rb/telemetry/domain/constants.rb +2 -2
- data/lib/splitclient-rb/telemetry/redis/redis_evaluation_producer.rb +4 -4
- data/lib/splitclient-rb/version.rb +1 -1
- data/lib/splitclient-rb.rb +4 -4
- data/splitclient-rb.gemspec +3 -2
- metadata +24 -11
- data/.travis.yml +0 -20
- data/lib/splitclient-rb/cache/stores/sdk_blocker.rb +0 -64
- data/lib/splitclient-rb/sse/event_source/back_off.rb +0 -25
- data/sonar-scanner.sh +0 -42
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'thread'
|
2
|
-
require 'timeout'
|
3
|
-
|
4
|
-
module SplitIoClient
|
5
|
-
module Cache
|
6
|
-
module Stores
|
7
|
-
class SDKBlocker
|
8
|
-
attr_reader :splits_repository
|
9
|
-
|
10
|
-
def initialize(splits_repository, segments_repository, config)
|
11
|
-
@splits_repository = splits_repository
|
12
|
-
@segments_repository = segments_repository
|
13
|
-
@config = config
|
14
|
-
@internal_ready = Concurrent::CountDownLatch.new(1)
|
15
|
-
|
16
|
-
if @config.standalone?
|
17
|
-
@splits_repository.not_ready!
|
18
|
-
@segments_repository.not_ready!
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def splits_ready!
|
23
|
-
if !ready?
|
24
|
-
@splits_repository.ready!
|
25
|
-
@config.logger.info('splits are ready')
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def segments_ready!
|
30
|
-
if !ready?
|
31
|
-
@segments_repository.ready!
|
32
|
-
@config.logger.info('segments are ready')
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def block(time = nil)
|
37
|
-
begin
|
38
|
-
timeout = time || @config.block_until_ready
|
39
|
-
Timeout::timeout(timeout) do
|
40
|
-
sleep 0.1 until ready?
|
41
|
-
end
|
42
|
-
rescue Timeout::Error
|
43
|
-
fail SDKBlockerTimeoutExpiredException, 'SDK start up timeout expired'
|
44
|
-
end
|
45
|
-
|
46
|
-
@config.logger.info('SplitIO SDK is ready')
|
47
|
-
end
|
48
|
-
|
49
|
-
def ready?
|
50
|
-
return true if @config.consumer?
|
51
|
-
@splits_repository.ready? && @segments_repository.ready?
|
52
|
-
end
|
53
|
-
|
54
|
-
def sdk_internal_ready
|
55
|
-
@internal_ready.count_down
|
56
|
-
end
|
57
|
-
|
58
|
-
def wait_unitil_internal_ready
|
59
|
-
@internal_ready.wait
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: false
|
2
|
-
|
3
|
-
module SplitIoClient
|
4
|
-
module SSE
|
5
|
-
module EventSource
|
6
|
-
class BackOff
|
7
|
-
def initialize(back_off_base, attempt = 0)
|
8
|
-
@attempt = attempt
|
9
|
-
@back_off_base = back_off_base
|
10
|
-
end
|
11
|
-
|
12
|
-
def interval
|
13
|
-
interval = (@back_off_base * (2**@attempt)) if @attempt.positive?
|
14
|
-
@attempt += 1
|
15
|
-
|
16
|
-
interval || 0
|
17
|
-
end
|
18
|
-
|
19
|
-
def reset
|
20
|
-
@attempt = 0
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/sonar-scanner.sh
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
#/bin/bash -e
|
2
|
-
|
3
|
-
sonar_scanner() {
|
4
|
-
local params=$@
|
5
|
-
|
6
|
-
sonar-scanner \
|
7
|
-
-Dsonar.host.url='https://sonarqube.split-internal.com' \
|
8
|
-
-Dsonar.login="$SONAR_TOKEN" \
|
9
|
-
-Dsonar.ws.timeout='300' \
|
10
|
-
-Dsonar.sources='lib' \
|
11
|
-
-Dsonar.projectName='ruby-client' \
|
12
|
-
-Dsonar.projectKey='ruby-client' \
|
13
|
-
-Dsonar.ruby.coverage.reportPaths='coverage/.resultset.json' \
|
14
|
-
-Dsonar.links.ci='https://travis-ci.com/splitio/ruby-client' \
|
15
|
-
-Dsonar.links.scm='https://github.com/splitio/ruby-client' \
|
16
|
-
${params}
|
17
|
-
|
18
|
-
return $?
|
19
|
-
}
|
20
|
-
|
21
|
-
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
22
|
-
sonar_scanner \
|
23
|
-
-Dsonar.pullrequest.provider='GitHub' \
|
24
|
-
-Dsonar.pullrequest.github.repository='splitio/ruby-client' \
|
25
|
-
-Dsonar.pullrequest.key=$TRAVIS_PULL_REQUEST \
|
26
|
-
-Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH \
|
27
|
-
-Dsonar.pullrequest.base=$TRAVIS_BRANCH
|
28
|
-
else
|
29
|
-
if [ "$TRAVIS_BRANCH" == 'master' ]; then
|
30
|
-
sonar_scanner \
|
31
|
-
-Dsonar.branch.name=$TRAVIS_BRANCH
|
32
|
-
else
|
33
|
-
if [ "$TRAVIS_BRANCH" == 'development' ]; then
|
34
|
-
TARGET_BRANCH='master'
|
35
|
-
else
|
36
|
-
TARGET_BRANCH='development'
|
37
|
-
fi
|
38
|
-
sonar_scanner \
|
39
|
-
-Dsonar.branch.name=$TRAVIS_BRANCH \
|
40
|
-
-Dsonar.branch.target=$TARGET_BRANCH
|
41
|
-
fi
|
42
|
-
fi
|