Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Modules\Automation\Queue\Application\Handler; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use App\Modules\Automation\Queue\Domain\Model\QueueJob; |
| 12 | use App\Modules\Automation\Queue\Domain\Repository\QueueRepositoryInterface; |
| 13 | |
| 14 | /** |
| 15 | * Job Handler Contract Interface. |
| 16 | * |
| 17 | * Handlers implement dedicated asynchronous execution logic for specific job types. |
| 18 | * |
| 19 | * @package App\Modules\Automation\Queue\Application\Handler |
| 20 | */ |
| 21 | interface JobHandlerInterface |
| 22 | { |
| 23 | /** |
| 24 | * Returns the unique job type string supported by this handler. |
| 25 | * |
| 26 | * @return string Job type machine name. |
| 27 | */ |
| 28 | public function supports(): string; |
| 29 | |
| 30 | /** |
| 31 | * Executes the background queue job in chunks with progress reporting and heartbeats. |
| 32 | * |
| 33 | * @param QueueJob $job Current job entity. |
| 34 | * @param QueueRepositoryInterface $queueRepository Queue repository for heartbeat updates. |
| 35 | * @return string Summary execution output text. |
| 36 | */ |
| 37 | public function handle(QueueJob $job, QueueRepositoryInterface $queueRepository): string; |
| 38 | } |