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
storetagged with every one ofnames.
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
nameforownerduringttl; returns whether it was free.override -
add(
String key, Object? value, {Duration? ttl}) → Future< bool> -
Stores only when
keyis absent (atomic per store scope).override -
decrement(
String key, [int by = 1]) → Future< int> -
Subtracts
byfrom the integer underkeyand 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
namewhoever holds it.override -
forever(
String key, Object? value) → Future< void> -
Stores
valueunderkeywith 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
byto the integer underkeyand returns the new value.override -
itemKey(
String key) → Future< String> -
The key
keyis stored under (Laravel'staggedItemKey, 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
valueforttl(null= forever).override -
putMany(
Map< String, Object?> values, {Duration? ttl}) → Future<void> -
Stores every entry of
values, forttlor forever.override -
releaseLock(
String name, String owner) → Future< bool> -
Releases the lock
nameifownerholds it; returns whether it did.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited