Task
- Full name:
\Codefy\Framework\Scheduler\Task - Parent interfaces:
\Codefy\Framework\Scheduler\Processor\Processor
Methods
withOptions
Return an instance with configured options.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$options | (array|int|string|bool|\Cron\CronExpression|null)[] |
withScheduler
Return an instance with scheduler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$schedule | \Codefy\Framework\Scheduler\Schedule |
withDispatcher
Return an instance with event dispatcher.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$dispatcher | \Psr\EventDispatcher\EventDispatcherInterface |
setUp
Called before a task is executed.
execute
Executes a task.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$schedule | \Codefy\Framework\Scheduler\Schedule |
tearDown
Called after a task is executed.
Inherited methods
mutexName
Unique name to use for a mutually exclusive lock.
maxRuntime
description
Set a command description.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$description | string |
canRunCommandInBackground
Check if the command can run in background.
canRunOnlyOneInstance
Check if process con only have one instance.
getExpression
Gets the current cron expression for the task.
isDue
Determine if the given command should run based on the Cron expression.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$timeZone | string|\DateTimeZone|null |
run
getCommand
Returns the command.