InlineCallbackTask
Runs a callback synchronously in-process, for tasks cheap enough not to need the queue.
A callback that throws propagates uncaught — the caller (the schedule:run command) is responsible for catching per-task failures, not this class.
Synopsis
Section titled “Synopsis”final class InlineCallbackTask implements ScheduledTaskAction
| Implements | ScheduledTaskAction |
| Source | InlineCallbackTask.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(Closure $callback): mixed
| Parameter | Type | Description |
|---|---|---|
$callback | Closure |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
label(): string | Returns a fixed label for the task. |
run(Container $container): void | Invokes the wrapped callback synchronously, passing it the container. |
label()
Section titled “label()”public function label(): string
Returns a fixed label for the task.
A closure has no meaningful name, so every inline task reports inline callback.
Returns string
public function run(Container $container): void
Invokes the wrapped callback synchronously, passing it the container.
Anything the callback throws propagates to the caller; this class does no error handling of its own.
| Parameter | Type | Description |
|---|---|---|
$container | Container |