evt-entity_cache 0.12.0.0 → 0.13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/entity_cache/storage/temporary/build.rb +1 -1
- data/lib/entity_cache/storage/temporary/{scope.rb → scope/defaults.rb} +4 -2
- data/lib/entity_cache/storage/temporary/scope/error.rb +9 -0
- data/lib/entity_cache/storage/temporary/scope/shared.rb +17 -3
- data/lib/entity_cache.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c760e8d0f0ab3b57d038d2611c3e79d5e5f226cb
|
4
|
+
data.tar.gz: 744488e69439058ff3f775a98f17b93c1551a06e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '07090ee107dc4cbe58dffcf6e9d96e492e40507b0dc4db5fe7dc85f4cbbdecfdb31a2b25f473eb8d217f0383351fac3600d827c0a4f8cdabeba26e5fc661ef04'
|
7
|
+
data.tar.gz: 1bbcfc1b53dfa8411446b5df243418eda16014b91c3977f37fa8e037354012dd88cd99384bfac9d7232af4dd35f282c5cdd38f25443e7d3a28028026a651be2c
|
@@ -4,11 +4,25 @@ class EntityCache
|
|
4
4
|
module Scope
|
5
5
|
class Shared < Temporary
|
6
6
|
def records
|
7
|
-
|
7
|
+
subject_registry[subject] ||= {}
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
|
10
|
+
def subject_registry
|
11
|
+
current_thread = Thread.current
|
12
|
+
|
13
|
+
if current_thread.thread_variable?(thread_local_variable)
|
14
|
+
subject_registry = current_thread.thread_variable_get(thread_local_variable)
|
15
|
+
else
|
16
|
+
subject_registry = {}
|
17
|
+
|
18
|
+
current_thread.thread_variable_set(thread_local_variable, subject_registry)
|
19
|
+
end
|
20
|
+
|
21
|
+
subject_registry
|
22
|
+
end
|
23
|
+
|
24
|
+
def thread_local_variable
|
25
|
+
:entity_cache_subject_registry
|
12
26
|
end
|
13
27
|
end
|
14
28
|
end
|
data/lib/entity_cache.rb
CHANGED
@@ -17,7 +17,8 @@ require 'entity_cache/storage/persistent/telemetry'
|
|
17
17
|
|
18
18
|
require 'entity_cache/storage/temporary'
|
19
19
|
require 'entity_cache/storage/temporary/build'
|
20
|
-
require 'entity_cache/storage/temporary/scope'
|
20
|
+
require 'entity_cache/storage/temporary/scope/defaults'
|
21
|
+
require 'entity_cache/storage/temporary/scope/error'
|
21
22
|
require 'entity_cache/storage/temporary/scope/exclusive'
|
22
23
|
require 'entity_cache/storage/temporary/scope/shared'
|
23
24
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-entity_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
@@ -150,7 +150,8 @@ files:
|
|
150
150
|
- lib/entity_cache/storage/persistent/telemetry.rb
|
151
151
|
- lib/entity_cache/storage/temporary.rb
|
152
152
|
- lib/entity_cache/storage/temporary/build.rb
|
153
|
-
- lib/entity_cache/storage/temporary/scope.rb
|
153
|
+
- lib/entity_cache/storage/temporary/scope/defaults.rb
|
154
|
+
- lib/entity_cache/storage/temporary/scope/error.rb
|
154
155
|
- lib/entity_cache/storage/temporary/scope/exclusive.rb
|
155
156
|
- lib/entity_cache/storage/temporary/scope/shared.rb
|
156
157
|
- lib/entity_cache/substitute.rb
|