TagSetCacheStore class final

Laravel's TagSet and TaggedCache over any store: each tag has a random id (tag:<name>:key), keys live under the SHA-1 of the ids, and a flush gives the tags new ids, so what they tagged is no longer reached (and expires, or leaves the memory store's LRU).

Implemented types

Constructors

TagSetCacheStore(CacheStore store, List<String> names, {String prefix = ''})
The values of store tagged with every one of names.

Properties

hashCode → int
The hash code for this object.
no setterinherited
names → List<String>
The tags, in the order given.
final
prefix → String
The key prefix.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scope → StateScope
Where the values live: one isolate, the process, or the cluster.
no setteroverride
store → CacheStore
The store holding the values.
final

Methods

acquireLock(String name, String owner, Duration ttl) → Future<bool>
Takes the lock name for owner during ttl; returns whether it was free.
override
add(String key, Object? value, {Duration? ttl}) → Future<bool>
Stores only when key is absent (atomic per store scope).
override
decrement(String key, [int by = 1]) → Future<int>
Subtracts by from the integer under key and returns the new value.
override
flush() → Future<void>
New ids for the tags (Laravel's TagSet::reset).
override
flushStale() → Future<void>
Drops expired entries from the tags' bookkeeping (Redis's tag sets; nothing elsewhere).
override
forceReleaseLock(String name) → Future<void>
Releases the lock name whoever holds it.
override
forever(String key, Object? value) → Future<void>
Stores value under key with no expiry.
override
forget(String key) → Future<bool>
Removes key; returns whether it existed.
override
get(String key) → Future<Object?>
The value of key, or null.
override
increment(String key, [int by = 1]) → Future<int>
Adds by to the integer under key and returns the new value.
override
itemKey(String key) → Future<String>
The key key is stored under (Laravel's taggedItemKey, after the cache prefix).
override
lockOwner(String name) → Future<String?>
The owner of the lock name, or null when it is free.
override
many(List<String> keys) → Future<Map<String, Object?>>
The values of keys, null for the missing ones.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String key, Object? value, {Duration? ttl}) → Future<void>
Stores value for ttl (null = forever).
override
putMany(Map<String, Object?> values, {Duration? ttl}) → Future<void>
Stores every entry of values, for ttl or forever.
override
releaseLock(String name, String owner) → Future<bool>
Releases the lock name if owner holds it; returns whether it did.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited