lutaml-store 0.3.2 → 0.3.3
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/docs/src/pages/stores.md +22 -0
- data/lib/lutaml/store/cache_store.rb +4 -2
- data/lib/lutaml/store/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b35bad6d5f81534647fb355041ff434f9155e4488121d0870ef40611c1b9dc93
|
|
4
|
+
data.tar.gz: 71bca0ca15d5134199bad07710cb2bad8b35c3369abc5426a22bfa299352ba4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb4a0da9eb8a5dc529d8dbac816b8e1c98cc0da1826b7c9be5e04ceb9ae92b7e1fb3bbac65eca28f7c7a90025adf7391918beb5270e5b081c92baee31ffb69c5
|
|
7
|
+
data.tar.gz: af1af6380f9cd19f0ae14f1d7fc7987ae15cc47f26535338d919fa8cac2f83ceef84a4084a7f80bf626617182da65318d0207c6086274df078b388dbb4811b65
|
data/docs/src/pages/stores.md
CHANGED
|
@@ -76,6 +76,28 @@ cache.fetch("key") { expensive_call } # block runs only on miss
|
|
|
76
76
|
|
|
77
77
|
Entries past their TTL are evicted lazily on access; when `max_size` is exceeded the least-recently-used entries are evicted first.
|
|
78
78
|
|
|
79
|
+
### TTL guarantees (pinned)
|
|
80
|
+
|
|
81
|
+
The TTL semantics are pinned by specs and safe to build expiry policy on:
|
|
82
|
+
|
|
83
|
+
- **Persistence** — entries serialize `created_at` as ISO-8601 with
|
|
84
|
+
microsecond precision, so a FileSystem (or SQLite) cache reopened in a new
|
|
85
|
+
process keeps every entry's original clock; expiry survives restarts.
|
|
86
|
+
The memory adapter keeps no state across processes by nature.
|
|
87
|
+
- **Clock** — wall clock, not monotonic. This is the deliberate trade:
|
|
88
|
+
wall-clock timestamps survive restarts, but a system clock jump changes
|
|
89
|
+
apparent freshness (a backward jump un-expires nothing an entry's absolute
|
|
90
|
+
`created_at + ttl` already expired). Consumers needing jump-immunity
|
|
91
|
+
re-derive freshness from the source.
|
|
92
|
+
- **Expired reads** — `get` on an expired entry returns `nil` **and deletes
|
|
93
|
+
the entry**: the key disappears from `keys`/`size`/`exists?`.
|
|
94
|
+
- **Sweep** — expiry is lazy-on-read plus an opportunistic
|
|
95
|
+
`cleanup_expired` (interval `cleanup_interval`, default 300 s) invoked
|
|
96
|
+
inside mutating reads. There is **no background reaper**; a consumer like
|
|
97
|
+
the relaton shard cache needs none.
|
|
98
|
+
- **TTL values** — `ttl: nil` (and no `default_ttl`) never expires;
|
|
99
|
+
`ttl: 0` is immediately expired.
|
|
100
|
+
|
|
79
101
|
## PackageStore — multi-model packages
|
|
80
102
|
|
|
81
103
|
```ruby
|
|
@@ -36,10 +36,12 @@ module Lutaml
|
|
|
36
36
|
|
|
37
37
|
def to_h
|
|
38
38
|
{
|
|
39
|
+
# sub-second precision: a second-truncated created_at shortens
|
|
40
|
+
# every restored TTL by up to a second (matters at small TTLs)
|
|
39
41
|
value: @value,
|
|
40
|
-
created_at: @created_at.iso8601,
|
|
42
|
+
created_at: @created_at.iso8601(6),
|
|
41
43
|
ttl: @ttl,
|
|
42
|
-
expires_at: expires_at&.iso8601,
|
|
44
|
+
expires_at: expires_at&.iso8601(6),
|
|
43
45
|
metadata: @metadata
|
|
44
46
|
}
|
|
45
47
|
end
|
data/lib/lutaml/store/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lutaml-store
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ronald Tse
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.8.
|
|
19
|
+
version: 0.8.156
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.8.
|
|
26
|
+
version: 0.8.156
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rubyzip
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|