eppo-server-sdk 0.2.4 → 0.3.0

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
  SHA256:
3
- metadata.gz: 98acb6907559d59d41dabba40eff3cc95404c1d2283144f73a64e05dd94b4688
4
- data.tar.gz: 86b21cbf7552a6641e34dafedb1c158812777d27821818ee3e067dd6ca1e6eff
3
+ metadata.gz: a49644b2f5b546e818c775dd1039ffe8cce65d0d9ef9fb638d07ee29218f6d45
4
+ data.tar.gz: ca6f781679ab965a7c4965a009b35db39ab59a008987d96dacd63d85210aa0fe
5
5
  SHA512:
6
- metadata.gz: 38d1f7c43ded991c029cd7ac3e3c3c71116862899008d7163d216be45dd585cc7a3ea00ba04870cba2f771aeb589a75b50835c2a4d4e792de3d886879bfda7bd
7
- data.tar.gz: 2e2e690225134fb4d76d36d605f4d391aeddd3b8d0f831e5f12516ca3d9fab2f5d4267812158d266a243b4d0f53d86a0d752d14a8420e6ad8bc996ded7f13184
6
+ metadata.gz: d55ec3fde4eb47875442968795f5990d6856cd59ac007d9188adddf09a98ae480d2711745a85795fff5ff2acf95ea8de534b5d29c6fccec63ff016aea0c503f2
7
+ data.tar.gz: 259184f4656e52ea8f02cc342e8a00d8153e207faa9bbdc08c801d7892fa2c0153315d939565045457c4041b7db87df1bdf30b81cc830333811d9549843bd736
@@ -20,9 +20,15 @@ module EppoClient
20
20
 
21
21
  def assign_configurations(configs)
22
22
  @lock.with_write_lock do
23
+ # Create a temporary new cache and populate it.
24
+ new_cache = EppoClient::LRUCache.new(@cache.size)
23
25
  configs.each do |key, config|
24
- @cache[key] = config
26
+ new_cache[key] = config
25
27
  end
28
+
29
+ # Replace the old cache with the new one.
30
+ # Performs an atomic swap.
31
+ @cache = new_cache
26
32
  end
27
33
  end
28
34
  end
@@ -5,7 +5,7 @@ module EppoClient
5
5
  # and re-inserting a key-value pair on access moves the key to the last position. When an
6
6
  # entry is added and the cache is full, the first entry is removed.
7
7
  class LRUCache
8
- attr_reader :cache
8
+ attr_reader :cache, :size
9
9
 
10
10
  # Creates a new LRUCache that can hold +size+ entries.
11
11
  def initialize(size)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EppoClient
4
- VERSION = '0.2.4'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eppo-server-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eppo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-12 00:00:00.000000000 Z
11
+ date: 2024-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -70,6 +70,26 @@ dependencies:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: 2.0.0
73
+ - !ruby/object:Gem::Dependency
74
+ name: semver2
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '3.4'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 3.4.2
83
+ type: :runtime
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.4'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 3.4.2
73
93
  - !ruby/object:Gem::Dependency
74
94
  name: rake
75
95
  requirement: !ruby/object:Gem::Requirement