Marten::Cache::Store::Null
Inherits Marten::Cache::Store::Base / Reference / Object
A cache store implementation that doesn't store any data.
Marten::Cache::Store::Null is a cache implementation that does not actually cache any data, but provides a way
to go through the caching interface. This can be useful in development and testing environments when caching is
not desired.
Instance methods
decrement(key : String, amount : Int32 = 1, expires_at : Time | Nil = nil, expires_in : Time::Span | Nil = nil, version : Int32 | Nil = nil, race_condition_ttl : Time::Span | Nil = nil, compress : Bool | Nil = nil, compress_threshold : Int32 | Nil = nil) : Int
Decrements the integer value associated with the given key.
It should be noted that this method supports a set of optional arguments:
amountallows to specify the amount used to decrement the integer value (defaults to1)expires_atallows to specify an absolute expiration time.expires_inallows to specify a relative expiration time.versionallows to specify a version value for the entry to write into the cache. When fetching entries, a mismatch between an entry's version and the requested version is treated like a cache miss.race_condition_ttlallows to specify a relative period of time during which an expired value is allowed to be returned while the new value is being generated and written to the cache. By leveraging this capability, it is possible to ensure that multiple processes that access an expired cache entry at the same time don't end up regenerating the new entry all at the same time.compressallows to specify whether new entries written to the cache should be compressed.compress_thresholdallows to specify a custom compression threshold. The compression threshold determines whether cached entries are compressed: if these entries are larger than the compression thresholed (which is expressed in bytes), then they will be compressed.
increment(key : String, amount : Int32 = 1, expires_at : Time | Nil = nil, expires_in : Time::Span | Nil = nil, version : Int32 | Nil = nil, race_condition_ttl : Time::Span | Nil = nil, compress : Bool | Nil = nil, compress_threshold : Int32 | Nil = nil) : Int
Increments the integer value associated with the given key.
It should be noted that this method supports a set of optional arguments:
amountallows to specify the amount used to increment the integer value (defaults to1)expires_atallows to specify an absolute expiration time.expires_inallows to specify a relative expiration time.versionallows to specify a version value for the entry to write into the cache. When fetching entries, a mismatch between an entry's version and the requested version is treated like a cache miss.race_condition_ttlallows to specify a relative period of time during which an expired value is allowed to be returned while the new value is being generated and written to the cache. By leveraging this capability, it is possible to ensure that multiple processes that access an expired cache entry at the same time don't end up regenerating the new entry all at the same time.compressallows to specify whether new entries written to the cache should be compressed.compress_thresholdallows to specify a custom compression threshold. The compression threshold determines whether cached entries are compressed: if these entries are larger than the compression thresholed (which is expressed in bytes), then they will be compressed.
write_entry(key : String, value : String, expires_in : Time::Span | Nil = nil, race_condition_ttl : Time::Span | Nil = nil)
Writes an entry to the cache.