Skip to content

ScheduledTaskAction

The “how to invoke it” strategy for a ScheduledTaskDefinition — either run inline (InlineCallbackTask) or dispatch onto the queue (DispatchJobTask).

The container is always passed explicitly rather than reached for statically, so every implementation stays constructor-injectable and testable.

interface ScheduledTaskAction

Implemented byDispatchJobTask, InlineCallbackTask
SourceScheduledTaskAction.php
MethodDescription
label(): stringReturns a short, stable identifier for the action, used in schedule listings and log output.
run(Container $container): voidPerforms the task, using the given container to reach any services it needs.

abstract public function label(): string

Returns a short, stable identifier for the action, used in schedule listings and log output.

It must not vary between processes for the same task: it is part of the overlap lock key derived by ScheduledTaskDefinition::lockKey().

Returns string

abstract public function run(Container $container): void

Performs the task, using the given container to reach any services it needs.

Implementations may either do the work in-process or hand it off; they are not expected to catch their own failures, as the caller running the schedule reports and isolates per-task errors.

ParameterTypeDescription
$containerContainer