Schedule
class Schedule mixin PendingEventAttributes
Traits
Constants
| SUNDAY |
|
| MONDAY |
|
| TUESDAY |
|
| WEDNESDAY |
|
| THURSDAY |
|
| FRIDAY |
|
| SATURDAY |
|
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected array | $events | All of the events on the schedule. |
|
| protected EventMutex | $eventMutex | The event mutex implementation. |
|
| protected SchedulingMutex | $schedulingMutex | The scheduling mutex implementation. |
|
| protected Dispatcher|null | $dispatcher | The job dispatcher implementation. |
|
| protected array<string, bool> | $mutexCache | The cache of mutex results. |
|
| protected string|null | $mutexCacheMinute | The minute currently represented by the in-memory mutex cache. |
|
| protected PendingEventAttributes|null | $attributes | The attributes to pass to the event. |
|
| protected PendingEventAttributes> | $groupStack | The schedule group attributes stack. |
|
| static bool | $pausable | Indicates if the scheduler can be paused. |
|
| static bool | $interruptible | Indicates if the scheduler can be interrupted. |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls into the schedule instance.
Add a new callback event to the schedule.
Add a new Artisan command event to the schedule.
Add a new job callback event to the schedule.
Dispatch the given job to the queue.
Dispatch the given unique job to the queue.
Dispatch the given job right now.
Add a new command event to the schedule.
Compile parameters for a command.
Compile array input for a command.
Determine if the server is allowed to run this event.
Get all of the events on the schedule that are due at the given time.
Get all of the events on the schedule.
Get all of the events on the schedule which run on any of the provided environments.
Specify the cache store that should be used to store mutexes.
Disable pause and interrupt polling for the scheduler.
Get the job dispatcher, if available.
Flush all static state.
Details
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
at line 514
__call(string $method, array $parameters)
Dynamically handle calls into the schedule instance.
at line 118
__construct(DateTimeZone|string|null $timezone = null)
Create a new schedule instance.
at line 141
CallbackEvent
call(callable|string|array $callback, array $parameters = [])
Add a new callback event to the schedule.
at line 158
Event
command(Command|string $command, array $parameters = [])
Add a new Artisan command event to the schedule.
at line 180
CallbackEvent
job(object|string $job, UnitEnum|string|null $queue = null, UnitEnum|string|null $connection = null)
Add a new job callback event to the schedule.
at line 223
protected void
dispatchToQueue(object $job, string|null $queue, string|null $connection)
Dispatch the given job to the queue.
at line 258
protected void
dispatchUniqueJobToQueue(object $job, string|null $queue, string|null $connection)
Dispatch the given unique job to the queue.
at line 288
protected void
dispatchNow(object $job)
Dispatch the given job right now.
at line 296
Event
exec(string $command, array $parameters = [], bool $isSystem = true)
Add a new command event to the schedule.
at line 314
void
group(Closure $events)
Create new schedule group.
at line 331
protected void
mergePendingAttributes(Event $event)
Merge the current group attributes with the given event.
at line 349
protected string
compileParameters(array $parameters)
Compile parameters for a command.
at line 367
string
compileArrayInput(int|string $key, array $value)
Compile array input for a command.
at line 389
bool
serverShouldRun(Event $event, DateTimeInterface $time)
Determine if the server is allowed to run this event.
at line 404
Collection
dueEvents(Application $app)
Get all of the events on the schedule that are due.
at line 412
Collection
dueEventsAt(Application $app, DateTimeInterface $time)
Get all of the events on the schedule that are due at the given time.
at line 423
array
events()
Get all of the events on the schedule.
at line 434
array
eventsForEnvironments(array $environments)
Get all of the events on the schedule which run on any of the provided environments.
at line 448
Schedule
useCache(UnitEnum|string|null $store)
Specify the cache store that should be used to store mutexes.
Boot-only. Mutates the shared mutex instances used by this worker's schedule; per-request use races across coroutines.
at line 473
static void
withoutInterruptionPolling()
Disable pause and interrupt polling for the scheduler.
Boot-only. Mutates process-global scheduler flags; runtime use changes pause and interrupt behavior for every concurrent scheduler run.
at line 484
protected Dispatcher
getDispatcher()
Get the job dispatcher, if available.
at line 504
static void
flushState()
Flush all static state.