Skip to content
docsv0.1.1

CronRegistry

An in-memory collection of {@see TaskDefinition}s. A host command (Task 11) assembles one from `config/cron.php` plus every booted plugin's {@see CronProviderInterface::cronTasks()}, then hands it to {@see CronRunner} (Task 10) to execute whatever is due.

CronRegistry::register()

public function register(Milpa\Ops\Cron\TaskDefinition $task): void

Agrega una tarea al registro. Registrar no la corre ni la programa: sólo la hace visible a {@see self::due()}.

Parameters

Parameters of register()
NameTypeDescription
$taskMilpa\Ops\Cron\TaskDefinition

CronRegistry::all()

public function all(): array

Returns

Every registered task, in registration order.

CronRegistry::due()

public function due(DateTimeImmutable $now): array

Las tareas que toca correr en `$now`. Recibir el instante en vez de leer el reloj es lo que deja probar esto sin esperar: el registro no sabe qué hora es, se lo dicen.

Parameters

Parameters of due()
NameTypeDescription
$nowDateTimeImmutable

Returns

The subset of registered tasks due to run at `$now`.