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): voidAgrega una tarea al registro. Registrar no la corre ni la programa: sólo la hace visible a {@see self::due()}.
Parameters
| Name | Type | Description |
|---|---|---|
| $task | Milpa\Ops\Cron\TaskDefinition |
CronRegistry::all()
public function all(): arrayReturns
Every registered task, in registration order.
CronRegistry::due()
public function due(DateTimeImmutable $now): arrayLas 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
| Name | Type | Description |
|---|---|---|
| $now | DateTimeImmutable |
Returns
The subset of registered tasks due to run at `$now`.