eppo-server-sdk 0.2.4 → 0.2.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 +4 -4
- data/lib/eppo_client/configuration_store.rb +7 -1
- data/lib/eppo_client/lru_cache.rb +1 -1
- data/lib/eppo_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c75a17999fe2f903a2bef17b02bfefd74a3668249f5b67254c8e0b41d21f27d8
|
4
|
+
data.tar.gz: 18e358b1910d97839d8d20653506aecc7db9986a6b3dee80c50065a27059c7a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa31863564c84dd92d515b493b2aa7e31604e409987d51556bc85868d642a09396c6f61b297302e92d0a6dd411e3b1403efbd56bc055478c94b7ed593f370285
|
7
|
+
data.tar.gz: b9b26bdca34234ce0c1a19c1b633bc78739a6115f752e900ceaeb3a9c91f0a2acaef13998cd0c0e9d6ee9cf4f66ad23424f96fa7ca40df573550d2a1c51ae364
|
@@ -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
|
-
|
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)
|
data/lib/eppo_client/version.rb
CHANGED
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
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eppo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|