class Schedule mixin PendingEventAttributes (View source)

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 DateTimeZone|string $timezone

The timezone the date should be evaluated on.

protected Dispatcher $dispatcher

The job dispatcher implementation.

protected array<string,bool> $mutexCache

The cache of mutex results.

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

static void
macro(string $name, object|callable $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Checks if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically handle calls into the schedule instance.

__construct(DateTimeZone|string|null $timezone = null)

Create a new schedule instance.

call(string|callable $callback, array $parameters = [])

Add a new callback event to the schedule.

command(Command|string $command, array $parameters = [])

Add a new Artisan command event to the schedule.

job(object|string $job, UnitEnum|string|null $queue = null, UnitEnum|string|null $connection = null)

Add a new job callback event to the schedule.

void
dispatchToQueue(object $job, string|null $queue, string|null $connection)

Dispatch the given job to the queue.

void
dispatchUniqueJobToQueue(object $job, string|null $queue, string|null $connection)

Dispatch the given unique job to the queue.

void
dispatchNow(object $job)

Dispatch the given job right now.

exec(string $command, array $parameters = [])

Add a new command event to the schedule.

void
group(Closure $events)

Create new schedule group.

void
mergePendingAttributes(Event $event)

Merge the current group attributes with the given event.

string
compileParameters(array $parameters)

Compile parameters for a command.

string
compileArrayInput(string|int $key, array $value)

Compile array input for a command.

bool
serverShouldRun(Event $event, DateTimeInterface $time)

Determine if the server is allowed to run this event.

dueEvents(Application $app)

Get all of the events on the schedule that are due.

Event[]
events()

Get all of the events on the schedule.

array
eventsForEnvironments(array $environments)

Get all of the events on the schedule which run on any of the provided environments.

$this
useCache(UnitEnum|string $store)

Specify the cache store that should be used to store mutexes.

getDispatcher()

Get the job dispatcher, if available.

static void
withoutInterruptionPolling()

Indicate that the scheduler should not poll for pause or interrupt signals.

Details

static void macro(string $name, object|callable $macro)

Register a custom macro.

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

static bool hasMacro(string $name)

Checks if macro is registered.

Parameters

string $name

Return Value

bool

static void flushMacros()

Flush the existing macros.

Return Value

void

static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Dynamically handle calls into the schedule instance.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

__construct(DateTimeZone|string|null $timezone = null)

Create a new schedule instance.

Parameters

DateTimeZone|string|null $timezone

Exceptions

RuntimeException

CallbackEvent call(string|callable $callback, array $parameters = [])

Add a new callback event to the schedule.

Parameters

string|callable $callback
array $parameters

Return Value

CallbackEvent

Event command(Command|string $command, array $parameters = [])

Add a new Artisan command event to the schedule.

Parameters

Command|string $command
array $parameters

Return Value

Event

CallbackEvent job(object|string $job, UnitEnum|string|null $queue = null, UnitEnum|string|null $connection = null)

Add a new job callback event to the schedule.

Parameters

object|string $job
UnitEnum|string|null $queue
UnitEnum|string|null $connection

Return Value

CallbackEvent

protected void dispatchToQueue(object $job, string|null $queue, string|null $connection)

Dispatch the given job to the queue.

Parameters

object $job
string|null $queue
string|null $connection

Return Value

void

Exceptions

RuntimeException

protected void dispatchUniqueJobToQueue(object $job, string|null $queue, string|null $connection)

Dispatch the given unique job to the queue.

Parameters

object $job
string|null $queue
string|null $connection

Return Value

void

Exceptions

RuntimeException

protected void dispatchNow(object $job)

Dispatch the given job right now.

Parameters

object $job

Return Value

void

Event exec(string $command, array $parameters = [])

Add a new command event to the schedule.

Parameters

string $command
array $parameters

Return Value

Event

void group(Closure $events)

Create new schedule group.

Parameters

Closure $events

Return Value

void

Exceptions

RuntimeException

protected void mergePendingAttributes(Event $event)

Merge the current group attributes with the given event.

Parameters

Event $event

Return Value

void

protected string compileParameters(array $parameters)

Compile parameters for a command.

Parameters

array $parameters

Return Value

string

string compileArrayInput(string|int $key, array $value)

Compile array input for a command.

Parameters

string|int $key
array $value

Return Value

string

bool serverShouldRun(Event $event, DateTimeInterface $time)

Determine if the server is allowed to run this event.

Parameters

Event $event
DateTimeInterface $time

Return Value

bool

Collection dueEvents(Application $app)

Get all of the events on the schedule that are due.

Parameters

Application $app

Return Value

Collection

Event[] events()

Get all of the events on the schedule.

Return Value

Event[]

array eventsForEnvironments(array $environments)

Get all of the events on the schedule which run on any of the provided environments.

Parameters

array $environments

Return Value

array

$this useCache(UnitEnum|string $store)

Specify the cache store that should be used to store mutexes.

Parameters

UnitEnum|string $store

Return Value

$this

protected Dispatcher getDispatcher()

Get the job dispatcher, if available.

Return Value

Dispatcher

Exceptions

RuntimeException

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.

Return Value

void