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
Class Method Details
.fetch(loader:, store:) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/rigor/cache/rbs_cache_producer.rb', line 18 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) do compute(loader) end end |