Class: Rigor::Cache::RbsCacheProducer
- Inherits:
-
Object
- Object
- Rigor::Cache::RbsCacheProducer
- Defined in:
- lib/rigor/cache/rbs_cache_producer.rb,
sig/rigor/cache.rbs
Overview
Base owning the shared producer fetch wiring; subclasses add a
PRODUCER_ID constant and a private self.compute(loader).
Direct Known Subclasses
RbsClassAncestorTable, RbsClassTypeParamNames, RbsConstantTable, RbsEnvironment, RbsKnownClassNames
Class Method Summary collapse
- .fetch(loader:, store:) ⇒ Object
-
.generation_cap ⇒ Integer
The generation cap this producer declares to
Cache::Store#evict!(issue #151).
Class Method Details
.fetch(loader:, store:) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rigor/cache/rbs_cache_producer.rb', line 27 def self.fetch(loader:, store:) # ADR-54 WD4 — the descriptor is identical for every producer consulting the same loader (same sig # files, same libraries), so the loader memoises one build per process instead of re-digesting every # .rbs file once per producer. descriptor = loader.rbs_cache_descriptor store.fetch_or_compute(producer_id: self::PRODUCER_ID, params: {}, descriptor: descriptor, generation_cap: generation_cap) do compute(loader) end end |
.generation_cap ⇒ Integer
The generation cap this producer declares to Cache::Store#evict!
(issue #151). rigor sig-gen infers the literal 2 from the base
body; the contract is the wider Integer, since a subclass may
override it.
23 24 25 |
# File 'lib/rigor/cache/rbs_cache_producer.rb', line 23 def self.generation_cap 2 end |