refresh_machines 0.7.3-x86_64-linux → 0.7.4-x86_64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56474d1f63c9d1f728448b8b81a659f1e597139f513903e42d86a2c4ed27def4
4
- data.tar.gz: 89acef17f6cb4dd67573360254ddf632f12c06de46f9f06ed2fa89b452d2d979
3
+ metadata.gz: 9e51894ecd148876860c81f0560e4cbc336fd4a6a6468c4672ff60b75c58d757
4
+ data.tar.gz: d9ccb59d820dfdf9f25e0f1e07b3b48d942cfe3f5817d4c3d7fe4898520b967c
5
5
  SHA512:
6
- metadata.gz: ef65bac90590319105f082b9afc871d06c7789fc6fc9590bc8184e850b1ca27dbd8cc481f527bdbf423ad362226c4d3bf102d5e19837b533a4f3aca1f2c0ae3d
7
- data.tar.gz: e2fb3d2c1cb015fa5ada08cf478567226a26a13a6f5e127b37c3ab9e9286c5859f2311d7e7fd9bf6be453d2be2f7f9d7eea8506b1f48cc7a189b4e54a5f70528
6
+ metadata.gz: '093a2a59a70c6465ebcb5838fa6755b1f24ea12329825a479f0a3d245c99a24d95fdcd86e2ff597fd91145d45767926ab4cd88c622637a2a6dec5ae42e2ea31b'
7
+ data.tar.gz: 8b25ec80f1c9ed4156c9713a1a72728a5f601cf426b5f2e8a3ee271142ebc6b613fab42b172bcb36b5842c5c2bbc4a341c42507ac41af492ba59cefd02d0257f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.4](https://github.com/seuros/refresh_machines/compare/refresh_machines/v0.7.3...refresh_machines/v0.7.4) (2026-11-16)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * accept every age the gem returns ([a09310d](https://github.com/seuros/refresh_machines/commit/a09310d1bed8a0c08e8f78c4e69ad94e459f8fd2))
9
+
3
10
  ## [0.7.3](https://github.com/seuros/refresh_machines/compare/refresh_machines/v0.7.2...refresh_machines/v0.7.3) (2026-11-16)
4
11
 
5
12
 
data/README.md CHANGED
@@ -289,11 +289,11 @@ refresher.decide(1, t0, 0) # => :zero_lead, a zero lease is overdue
289
289
 
290
290
  ## The Rules of the Quartermaster
291
291
 
292
- - **Everything is an Integer** in `0..2**64-1`, except instants (below). Floats, nil and strings raise `TypeError`. Out of range raises `RangeError`. A policy argument that isn't a `Policy` raises `TypeError`. An id the refresher could never have issued, one whose sequence (the low 48 bits) is zero, raises `RangeError` wherever a lease or waiter id is taken (`store`, `fail`, `abandon`, `cancel`, `flight`), before the refresher is asked.
292
+ - **Everything is an Integer** in `0..2**64-1`, except instants and ages (below). Floats, nil and strings raise `TypeError`. Out of range raises `RangeError`. A policy argument that isn't a `Policy` raises `TypeError`. An id the refresher could never have issued, one whose sequence (the low 48 bits) is zero, raises `RangeError` wherever a lease or waiter id is taken (`store`, `fail`, `abandon`, `cancel`, `flight`), before the refresher is asked.
293
293
  - **Values are valid or do not exist.** Every Data value checks itself through the core when it is built, by the gem or by hand: `Policy` windows in `0..2**64-1`; `Fresh#age`, `Stale#age` and `Backoff#until` Integer nanoseconds up to the core's `Duration::MAX`; a `Stale#revalidation` that is a `Lead`, `:in_flight`, a `Backoff` or an `Unavailable`; lease, waiter and flight ids with a nonzero sequence; a `Wait` or `Notification` whose waiter is of its flight's scope and issued after it; an `Unavailable#refusal` that is a refusal symbol; an `outcome` of `:completed` or `:abandoned`. The wrong type raises `TypeError`, a value outside that `RangeError`: `Fetch.new(0)`, `Wait.new(2, 3)` and `Unavailable.new(:nope)` raise.
294
294
  - **The binding never loses work.** Every argument is converted before the core is called, and every class was resolved once, when the extension loaded. A mutating call whose answer is a Ruby object (`decide`, `sweep`, `poll`, `drain`) decides on a copy of the refresher and keeps it only once the answer is built, natively (allocate, fill, freeze, no Ruby `initialize`); `drain` and `sweep` read into a buffer first. Frozen meanwhile is `FrozenError`, changed meanwhile `RuntimeError`; a call that raises changed nothing.
295
295
  - **Values are sealed, and the binding is the authority.** Subclassing a value class raises `TypeError` and `allocate` is undefined. Sealing stops accidents, not reflection (a named subclass's constant is bound before the raise, `Marshal.load` skips `initialize`), so a value the binding reads (a `Policy`, a `Stale`'s revalidation) must be an instance of exactly its class, and its fields are checked again: a forged one raises `TypeError` or `RangeError`.
296
- - **Time is Integer nanoseconds.** Instants (`now`, `Backoff#until`) and spans (ages, the three policy windows, `lead_for`, `retry_after`) alike, in and out. A Float, a Rational or anything else that isn't an Integer raises `TypeError`. A span argument is in `0..2**64-1`; `now` runs over the whole Rust `Duration` range, `0..Duration::MAX` nanoseconds (about `1.8e28`), so every `Backoff#until` the refresher answers reads back as `now`. Outside its range a value raises `RangeError`. Nothing wraps: a returned age or `Backoff#until` is the exact sum, even past `2**64-1`.
296
+ - **Time is Integer nanoseconds.** Instants (`now`, `Backoff#until`) and spans (ages, the three policy windows, `lead_for`, `retry_after`) alike, in and out. A Float, a Rational or anything else that isn't an Integer raises `TypeError`. `now` and an age argument (`put`, `store`, `Policy#state`, `#while_revalidate?`, `#if_error?`) run over the whole Rust `Duration` range, `0..Duration::MAX` nanoseconds (about `1.8e28`), so every `Backoff#until` the refresher answers reads back as `now` and every age it answers (`age`, `fail`, `stale_if_error`, `Fresh#age`, `Stale#age`) reads back as an age. The other spans (the policy windows, `lead_for`, `retry_after`) are in `0..2**64-1`. Outside its range a value raises `RangeError`. Nothing wraps: a returned age or `Backoff#until` is the exact sum, even past `2**64-1`.
297
297
  - **Refusals don't raise.** `:time_regressed`, `:zero_lead`, `:entries_full`, `:flights_full`, `:waiters_full`, `:exhausted` and `:stale` are answers, and a refused call changes nothing.
298
298
  - **Every answer, by method.**
299
299
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RefreshMachines
4
- VERSION = '0.7.3'
4
+ VERSION = '0.7.4'
5
5
  end
@@ -13,11 +13,11 @@ module RefreshMachines
13
13
  # Every instant and span in this gem is Integer nanoseconds: `now` as read
14
14
  # from `Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond)`, and
15
15
  # every age, window, `lead_for`, `retry_after` and `Backoff#until`.
16
- # Span arguments, and the Policy windows, are in 0..2**64-1; `now` is in
17
- # 0..`Duration::MAX`, so every instant the refresher answers reads back as
18
- # `now`. An age or instant the core answers (Fresh, Stale, Backoff) may be
19
- # past 2**64-1, up to `Duration::MAX`, because sums saturate instead of
20
- # wrapping.
16
+ # `now` and age arguments are in 0..`Duration::MAX`, so every instant and
17
+ # age the refresher answers reads back; the other span arguments, and the
18
+ # Policy windows, are in 0..2**64-1. An age or instant the core answers
19
+ # (Fresh, Stale, Backoff, `fail`, `age`) may be past 2**64-1, up to
20
+ # `Duration::MAX`, because sums saturate instead of wrapping.
21
21
  Policy = Data.define(:fresh_for, :stale_while_revalidate, :stale_if_error) do
22
22
  def initialize(fresh_for:, stale_while_revalidate:, stale_if_error:)
23
23
  RefreshMachines.__send__(:__policy, fresh_for, stale_while_revalidate, stale_if_error)
@@ -2,11 +2,13 @@ module RefreshMachines
2
2
  VERSION: String
3
3
 
4
4
  # Every instant (`now`, `Backoff#until`) and span (ages, policy windows,
5
- # `lead_for`, `retry_after`) is Integer nanoseconds. A span argument must be
6
- # in 0..2**64-1; a `now` argument may be anything in 0..Duration::MAX, so
7
- # every instant the refresher answers (a `Backoff#until` past 2**64-1
8
- # included) reads back as `now`. A returned sum may be larger than 2**64-1,
9
- # up to the core's Duration::MAX; it never wraps.
5
+ # `lead_for`, `retry_after`) is Integer nanoseconds. A `now` or age argument
6
+ # (`put`, `store`, Policy#state, #while_revalidate?, #if_error?) may be
7
+ # anything in 0..Duration::MAX, so every instant and age the refresher
8
+ # answers (past 2**64-1 included) reads back. The other span arguments
9
+ # (policy windows, `lead_for`, `retry_after`) must be in 0..2**64-1. A
10
+ # returned sum may be larger than 2**64-1, up to the core's Duration::MAX;
11
+ # it never wraps.
10
12
  #
11
13
  # Every Data value validates when built, by the gem or by hand: TypeError
12
14
  # for the wrong type, RangeError for a value the core rejects.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refresh_machines
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Abdelkader Boudih