ff-ruby-server-sdk 1.0.3 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3739ab255fb8e84c6ceb4030b4954e3003363849da66e2a40944f612156aa35a
4
- data.tar.gz: 9114143979ff5ce2d456e3733a729727521459b702f5ac7aaead5415098918b8
3
+ metadata.gz: fcebe5eaa757a9376616a1a1db63c1a829f435b113ad140d228cb5ee18b54ffe
4
+ data.tar.gz: 17698d0edbc9c2a4d6bfd93f599d1f3acb844b45c88083c272d6f9d2542e00b9
5
5
  SHA512:
6
- metadata.gz: 0d0f6a3ead59558beb66acf23199f32bca8d6ada666093353a25459671816122665d77c49922c751cea1b30e1132f9d75ca89d992a28d88038df0e5da7f303b9
7
- data.tar.gz: 2f3ac65c8253548bb2943ae1091fe6de24e44999fb9a9a08c184dbf7e267d21adc59f06e0de706345bddab5dd381ad872bca6b086c3eb635000d2762fee01bc2
6
+ metadata.gz: 84e5149958d5d0c15ae08644eb8803b49b4d31299abdd8c054e804e830e2c6b93c18f9701403017b87a7bbf2e2582c49777ba71edc01de2d6a7bdac9abf959ed
7
+ data.tar.gz: e8d093a568bee30b277774d6b3173ba30bd757033b265686356ee6490c0e57f8046826e3fe9e56f8673439e1eb2e4ce979197384976e0a45c1866aebf7c39d7b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [1.0.5]
2
+
3
+ - [FFM-6362] - Ruby FF SDK is not waiting initialization when using "wait_for_initialization" method
4
+
5
+ # [1.0.4]
6
+
7
+ - [FFM-5478] Fixes bug caching some flags due to encoding
8
+
1
9
  # [1.0.3]
2
10
 
3
11
  - [FFM-4058] Fixes bug in storing target segments
@@ -21,7 +21,10 @@ logger.info "Harness Ruby SDK Getting Started"
21
21
  client = CfClient.instance
22
22
 
23
23
  client.init(apiKey, ConfigBuilder.new.logger(logger).build)
24
+
25
+ logger.info "----- initialization started ----- "
24
26
  client.wait_for_initialization
27
+ logger.info "----- initialization done ----- "
25
28
 
26
29
  # Create a target (different targets can get different results based on rules. This include a custom attribute 'location')
27
30
  target = Target.new("RubySDK", identifier="rubysdk", attributes={"location": "emea"})
@@ -21,22 +21,6 @@ class DefaultCache < Cache
21
21
 
22
22
  lambda = lambda { |*key| @logger.debug "Retrieved #{key}" }
23
23
 
24
- cache_dir = "./cache"
25
- unless directory_exists?(cache_dir)
26
-
27
- FileUtils.mkdir_p cache_dir
28
- unless directory_exists?(cache_dir)
29
-
30
- raise "Failed to initialize filesystem cache at: " + cache_dir
31
- end
32
- end
33
-
34
- @filesystem = CacheBuilder.with(FileCache)
35
- .set_store(cache_dir)
36
- .set_max(@capacity)
37
- .set_post_get(lambda)
38
- .build
39
-
40
24
  @in_memory = CacheBuilder.with(Cache)
41
25
  .set_max(@capacity)
42
26
  .set_post_get(lambda)
@@ -44,16 +28,13 @@ class DefaultCache < Cache
44
28
  end
45
29
 
46
30
  def verify
47
-
48
- @in_memory != nil && @filesystem != nil && @capacity > 0
31
+ @in_memory != nil && @capacity > 0
49
32
  end
50
33
 
51
34
  def set(key, value)
52
35
 
53
36
  begin
54
37
  @in_memory.put(key, value)
55
- @filesystem.put(key, value)
56
- keys.add(key)
57
38
 
58
39
  rescue ArgumentError => e
59
40
 
@@ -66,15 +47,6 @@ class DefaultCache < Cache
66
47
  def get(key)
67
48
 
68
49
  value = @in_memory.get(key)
69
-
70
- if value == nil
71
-
72
- value = @filesystem.get(key)
73
- if value != nil
74
-
75
- @in_memory.put(key, value)
76
- end
77
- end
78
50
  value
79
51
  end
80
52
 
@@ -90,11 +62,6 @@ class DefaultCache < Cache
90
62
  @in_memory.invalidate(key)
91
63
  end
92
64
 
93
- if @filesystem.exists?(key)
94
-
95
- @filesystem.invalidate(key)
96
- end
97
-
98
65
  @keys.delete(key)
99
66
  end
100
67
 
@@ -223,6 +223,8 @@ class InnerClient < ClientCallback
223
223
  return
224
224
  end
225
225
 
226
+ @config.logger.info "All processors now ready"
227
+
226
228
  @initialized = true
227
229
 
228
230
  # TODO: notify - Reactivity support
@@ -262,7 +264,8 @@ class InnerClient < ClientCallback
262
264
  @repository = StorageRepository.new(@config.cache, @repository_callback, @config.store, @config.logger)
263
265
 
264
266
  @metrics_callback = InnerClientMetricsCallback.new(self, @config.logger)
265
- @metrics_processor = MetricsProcessor.new(@connector, @config, @metrics_callback)
267
+ @metrics_processor = MetricsProcessor.new
268
+ @metrics_processor.init(@connector, @config, @metrics_callback)
266
269
 
267
270
  @evaluator = Evaluator.new(@repository, logger = @config.logger)
268
271
  @evaluator_callback = InnerClientFlagEvaluateCallback.new(@metrics_processor, logger = @config.logger)
@@ -275,8 +278,8 @@ class InnerClient < ClientCallback
275
278
  logger = @config.logger
276
279
  )
277
280
 
278
- @poll_processor = PollingProcessor.new(
279
-
281
+ @poll_processor = PollingProcessor.new
282
+ @poll_processor.init(
280
283
  connector = @connector,
281
284
  repository = @repository,
282
285
  poll_interval_in_sec = @config.poll_interval_in_seconds,
@@ -291,7 +294,8 @@ class InnerClient < ClientCallback
291
294
  logger = @config.logger
292
295
  )
293
296
 
294
- @update_processor = UpdateProcessor.new(
297
+ @update_processor = UpdateProcessor.new
298
+ @update_processor.init(
295
299
 
296
300
  connector = @connector,
297
301
  repository = @repository,
@@ -9,7 +9,7 @@ require_relative "../api/summary_metrics"
9
9
 
10
10
  class MetricsProcessor < Closeable
11
11
 
12
- def initialize(
12
+ def init(
13
13
 
14
14
  connector,
15
15
  config,
@@ -2,7 +2,7 @@ require_relative "../common/closeable"
2
2
 
3
3
  class PollingProcessor < Closeable
4
4
 
5
- def initialize(
5
+ def init(
6
6
 
7
7
  connector,
8
8
  repository,
@@ -68,7 +68,7 @@ class PollingProcessor < Closeable
68
68
 
69
69
  if s != nil
70
70
 
71
- @repository.set_flag(s.identifier, s)
71
+ @repository.set_segment(s.identifier, s)
72
72
  segments.push(s)
73
73
  end
74
74
  }
@@ -4,7 +4,7 @@ require_relative "../common/closeable"
4
4
 
5
5
  class UpdateProcessor < Closeable
6
6
 
7
- def initialize(
7
+ def init(
8
8
 
9
9
  connector,
10
10
  repository,
@@ -5,7 +5,7 @@ module Ff
5
5
  module Server
6
6
  module Sdk
7
7
 
8
- VERSION = "1.0.3"
8
+ VERSION = "1.0.5"
9
9
  end
10
10
  end
11
11
  end
data/scripts/sdk_specs.sh CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
2
 
3
3
  export ff_ruby_sdk="ff-ruby-server-sdk"
4
- export ff_ruby_sdk_version="1.0.3"
4
+ export ff_ruby_sdk_version="1.0.5"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ff-ruby-server-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'Miloš Vasić, cyr.: Милош Васић'
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-18 00:00:00.000000000 Z
11
+ date: 2023-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake