WorkerCachedMaintenanceMode
class WorkerCachedMaintenanceMode implements MaintenanceMode
Properties
| static protected null|array{active: bool, data: array} | $snapshot | The cached maintenance mode snapshot. |
|
| static protected CarbonImmutable|null | $refreshedAt | The time when the cached snapshot was last refreshed. |
Methods
Create a new worker-cached maintenance mode instance.
Take the application down for maintenance.
Take the application out of maintenance.
Determine if the application is currently down for maintenance.
Get the maintenance mode data payload.
Flush the cached maintenance mode state.
Load the maintenance mode snapshot from the underlying driver.
Determine if the cached snapshot should be refreshed.
Details
at line 30
__construct(MaintenanceMode $driver, int $refreshInterval = 5)
Create a new worker-cached maintenance mode instance.
at line 39
void
activate(array $payload)
Take the application down for maintenance.
at line 49
void
deactivate()
Take the application out of maintenance.
at line 59
bool
active()
Determine if the application is currently down for maintenance.
at line 67
array
data()
Get the maintenance mode data payload.
at line 75
static void
flushCache()
Flush the cached maintenance mode state.
at line 90
protected array
loadSnapshot()
Load the maintenance mode snapshot from the underlying driver.
The active state and payload are read separately from the driver, then retained together so subsequent calls within the refresh interval use the same per-worker snapshot.
at line 110
protected bool
shouldRefreshSnapshot()
Determine if the cached snapshot should be refreshed.