Method: AsyncStorage::Allocator#refresh

Defined in:
lib/async_storage/allocator.rb

#refreshObject, NilClass

Invalidate object with the given key and update content according to the strategy

Returns:

  • (Object, NilClass)

    Stale object or nil when it does not exist



103
104
105
106
107
# File 'lib/async_storage/allocator.rb', line 103

def refresh
  breaker.run(fallback: -> { fetch! }) do
    get.tap { invalidate }
  end
end