ModelCacheCoordinator
class ModelCacheCoordinator
Coordinate shared model cache fills and exact invalidations.
Constants
| private FILL_LOCK_SECONDS |
The duration of a model cache fill lock. |
| private INVALIDATION_WAIT_SECONDS |
The maximum time an invalidation waits for a fill lock. |
| private INVALIDATION_RETRY_MILLISECONDS |
The delay between invalidation lock acquisition attempts. |
| private MUTATION_BATCH_SIZE |
The maximum number of models written and invalidated per batch. |
| private ENVELOPE_MARKER_KEY |
The envelope marker key. |
| private ENVELOPE_MARKER_VALUE |
The envelope marker value. |
| private ENVELOPE_VALUE_KEY |
The envelope value key. |
Methods
Determine whether the source has a transaction that prevents shared caching.
Retrieve or fill a shared model cache entry.
Details
at line 63
__construct(Container $container)
Create a model cache coordinator.
at line 72
bool
hasApplicableTransaction(Closure $source)
Determine whether the source has a transaction that prevents shared caching.
at line 88
mixed
fill(Repository $cache, Closure $source, string $key, int $ttl, Closure $read, bool $cacheNull = true, Closure|null $writeCache = null)
Retrieve or fill a shared model cache entry.
at line 160
int
mutate(Builder $query, Closure $write, Closure $invalidate)
Mutate selected models atomically and invalidate each written batch.
at line 205
bool
invalidate(Repository $cache, string $key)
Invalidate an exact shared model cache entry.