Module: RactorRailsShim::ReflectionMemoPatch
- Included in:
- ReflectionAbstractPatch, ReflectionAssociationPatch, ReflectionMacroPatch, ReflectionThroughPatch
- Defined in:
- lib/ractor_rails_shim/patches/activerecord_reflection.rb
Instance Method Summary collapse
-
#rrs_refl_cache ⇒ Object
Per-worker memoization cache for reflection values.
Instance Method Details
#rrs_refl_cache ⇒ Object
Per-worker memoization cache for reflection values. Defined as a plain
def (NOT define_method/block) so the method body is a shareable Method
— a block-based helper would be a Proc created in the main Ractor and
would raise "un-shareable Proc in a different Ractor" when called in a
worker.
22 23 24 |
# File 'lib/ractor_rails_shim/patches/activerecord_reflection.rb', line 22 def rrs_refl_cache Ractor.current[:__rrs_refl_cache__] ||= {} end |