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 Event> | $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 schedule should check for the paused signal in the cache. |
|
| static bool | $interruptible | Indicates if the schedule should check for the interrupt signal in the cache. |
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.
Get the job dispatcher, if available.
Indicate that the scheduler should not poll for pause or interrupt signals.
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 501
mixed
__call(string $method, array $parameters)
Dynamically handle calls into the schedule instance.
at line 115
__construct(DateTimeZone|string|null $timezone = null)
Create a new schedule instance.
at line 132
CallbackEvent
call(callable|string|array $callback, array $parameters = [])
Add a new callback event to the schedule.
at line 149
Event
command(Command|string $command, array $parameters = [])
Add a new Artisan command event to the schedule.
at line 177
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 244
protected void
dispatchUniqueJobToQueue(object $job, string|null $queue, string|null $connection)
Dispatch the given unique job to the queue.
at line 268
protected void
dispatchNow(object $job)
Dispatch the given job right now.
at line 276
Event
exec(string $command, array $parameters = [], bool $isSystem = true)
Add a new command event to the schedule.
at line 294
void
group(Closure $events)
Create new schedule group.
at line 311
protected void
mergePendingAttributes(Event $event)
Merge the current group attributes with the given event.
at line 332
protected string
compileParameters(array $parameters)
Compile parameters for a command.
at line 350
string
compileArrayInput(int|string $key, array $value)
Compile array input for a command.
at line 372
bool
serverShouldRun(Event $event, DateTimeInterface $time)
Determine if the server is allowed to run this event.
at line 387
Collection
dueEvents(Application $app)
Get all of the events on the schedule that are due.
at line 395
Collection
dueEventsAt(Application $app, DateTimeInterface $time)
Get all of the events on the schedule that are due at the given time.
at line 406
array
events()
Get all of the events on the schedule.
at line 417
array
eventsForEnvironments(array $environments)
Get all of the events on the schedule which run on any of the provided environments.
at line 431
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 455
protected Dispatcher
getDispatcher()
Get the job dispatcher, if available.
at line 480
static void
withoutInterruptionPolling()
Indicate that the scheduler should not poll for pause or interrupt signals.
This prevents the scheduler from hitting the application cache to determine if it needs to pause or interrupt.
Boot-only. Mutates process-global scheduler flags; runtime use changes pause and interrupt behavior for every concurrent scheduler run.
at line 489
static void
flushState()
Flush all static state.