evt-entity_cache 0.17.0.2 → 0.18.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/record.rb +11 -25
- data/lib/loader.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae771223b42527de66fc9419257d998984f89e5b020e78ed592b00dfba06d2f8
|
4
|
+
data.tar.gz: cbda82a45cd3188c808807bcfff540578ea98da9d51d6f1558408d746170a60f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92cee7b9ede8900a43312a1956fe2d9270706b26da5d52c0e42adb2510b5781d583a2738eef05bb9b5ed148b8d4534372f1138792fa6b4adcfcc909b78273c44
|
7
|
+
data.tar.gz: d832639518bca3fb8b6f016d888648e548e649a1f43c7560600925af377bed22d7a5313df3a08ab3b812c3808829964e90402ec9898c06db0555eafbb3303111
|
data/lib/entity_cache/record.rb
CHANGED
@@ -9,18 +9,8 @@ class EntityCache
|
|
9
9
|
)
|
10
10
|
|
11
11
|
class Record
|
12
|
-
include Dependency
|
13
|
-
|
14
|
-
dependency :clock, Clock::UTC
|
15
|
-
|
16
|
-
def configure
|
17
|
-
Clock::UTC.configure(self)
|
18
|
-
end
|
19
|
-
|
20
12
|
def self.build(id, entity, version, time, persisted_version: nil, persisted_time: nil)
|
21
|
-
|
22
|
-
instance.configure
|
23
|
-
instance
|
13
|
+
new(id, entity, version, time, persisted_version, persisted_time)
|
24
14
|
end
|
25
15
|
|
26
16
|
def self.destructure(instance, includes=nil)
|
@@ -28,26 +18,22 @@ class EntityCache
|
|
28
18
|
end
|
29
19
|
|
30
20
|
def age_milliseconds
|
31
|
-
Clock::UTC.elapsed_milliseconds(time,
|
21
|
+
Clock::UTC.elapsed_milliseconds(time, Clock::UTC.now)
|
32
22
|
end
|
33
23
|
|
34
24
|
def persisted_age_milliseconds
|
35
|
-
if persisted_time.nil?
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
)
|
42
|
-
end
|
25
|
+
return nil if persisted_time.nil?
|
26
|
+
|
27
|
+
Clock::UTC.elapsed_milliseconds(
|
28
|
+
persisted_time,
|
29
|
+
time
|
30
|
+
)
|
43
31
|
end
|
44
32
|
|
45
33
|
def persisted_age_versions
|
46
|
-
if persisted_version.nil?
|
47
|
-
|
48
|
-
|
49
|
-
version - persisted_version
|
50
|
-
end
|
34
|
+
return nil if persisted_version.nil?
|
35
|
+
|
36
|
+
version - persisted_version
|
51
37
|
end
|
52
38
|
end
|
53
39
|
end
|
data/lib/loader.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
lib/entity_cache.rb
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.18.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-configure
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- lib/entity_cache/store/internal/scope/thread.rb
|
120
120
|
- lib/entity_cache/store/internal/substitute.rb
|
121
121
|
- lib/entity_cache/substitute.rb
|
122
|
+
- lib/loader.rb
|
122
123
|
homepage: https://github.com/eventide-project/entity-cache
|
123
124
|
licenses:
|
124
125
|
- MIT
|
@@ -139,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
140
|
version: '0'
|
140
141
|
requirements: []
|
141
142
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.7.
|
143
|
+
rubygems_version: 2.7.3
|
143
144
|
signing_key:
|
144
145
|
specification_version: 4
|
145
146
|
summary: Cache of entities retrieved by an entity-store, with in-memory temporary
|