lib/maglev/utils/memory_stores.rb
# this streamlined version of fetch will run the block if nil is cached, unlike
# the normal implemention which will cache nil and return it without calling the block
this streamlined version of fetch will run the block if nil is cached, unlike
the normal implemention which will cache nil and return it without calling the block
this streamlined version of fetch will run the block if nil is cached unlike the normal implemention which will cache nil and return it without calling the block
def fetch(key, force: false)
        if force
          value = yield if block_given?
          write(key, value) if value
        else
          value = @cache.read(key)
          unless value
            value = yield if block_given?
            @cache.write(key, value) if value
          end
        end
        value
      end
def fetch ( key , force : false ) if force value = yield if block_given? write ( key , value ) if value else value = @cache . read ( key ) unless value value = yield if block_given? @cache . write ( key , value ) if value end end value end
this streamlined version of fetch will run the block if nil is cached, unlike
the normal implemention which will cache nil and return it without calling the block
this streamlined version of fetch will run the block if nil is cached unlike the normal implemention which will cache nil and return it without calling the block
key
<not_specific>
force
<not_specific>