Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray\Contract; |
| 6 | |
| 7 | /** |
| 8 | * Work that `Cosray\Queue` runs outside the request that pushed it. |
| 9 | * |
| 10 | * The runner builds the job through the container, so its constructor |
| 11 | * gets services, but never the request: a job may run after the response, |
| 12 | * from cron or in a daemon. A job runs at least once and may run again if |
| 13 | * its runner dies before recording the result. An exception makes it run |
| 14 | * again later; `Cosray\Exception\JobFailed` fails it without retries. |
| 15 | */ |
| 16 | interface Job |
| 17 | { |
| 18 | /** @param array<array-key, mixed> $payload as pushed, decoded from JSON */ |
| 19 | public function handle(array $payload): void; |
| 20 | } |