CronTable final class
Minn\Runtime\CronTable · public/minn/src/Minn/Runtime/CronTable.php · 133 lines
The cron option's shape, operated on as data: timestamp => hook => key => entry, kept in natural timestamp order. The key is the reference's own (a hash of the serialized argument list), so both stacks read one table.
Public
| static | key(array $args): string# | The key an event's arguments hash to. |
| static | fromBlob(?string $blob): array# | The table read from the option's stored blob: the version marker dropped, timestamps in order, an unreadable or absent blob empty. @return array<int, array<string, array<string, array<string, mixed>>>> |
| static | hasNear(array $crons, int $timestamp, string $hook, string $key, int $window): bool# | Whether the same hook and arguments are already scheduled within the window around the timestamp. |
| static | insert(array $crons, int $timestamp, string $hook, string $key, array $entry): array# | The table with an event added at a timestamp. |
| static | remove(array $crons, int $timestamp, string $hook, string $key): array# | The table with one event removed. |
| static | removeHook(array $crons, string $hook): array# | The table with every event of a hook removed. @return array{0: array, 1: int} the table without the hook, and how many entries went |
| static | timestampsFor(array $crons, string $hook, string $key): array# | When a hook and key are scheduled. @return list<int> every timestamp the hook and arguments are scheduled at |
| static | find(array $crons, string $hook, string $key, ?int $timestamp): ?array# | The entry for the hook and arguments at a timestamp, or at the next one when no timestamp is given, as [timestamp, entry]. |
| static | nextRun(int $timestamp, int $interval, int $now): int# | The next run of a recurring event: one interval from now, aligned to the original timestamp when it is in the past. |
| static | due(array $crons, int $now): array# | The timestamps at or before now, in order. |
Nothing matches.