Skip to content

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.

final class InlineCallbackTask implements ScheduledTaskAction

ImplementsScheduledTaskAction
SourceInlineCallbackTask.php

public function __construct(Closure $callback): mixed

ParameterTypeDescription
$callbackClosure

Returns mixed

MethodDescription
label(): stringReturns a fixed label for the task.
run(Container $container): voidInvokes the wrapped callback synchronously, passing it the container.

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.

ParameterTypeDescription
$containerContainer