1 | <?php |
||
7 | abstract class Job |
||
8 | { |
||
9 | /** |
||
10 | * @var int |
||
11 | */ |
||
12 | protected $maxAttempts = 1; |
||
13 | |||
14 | /** |
||
15 | * @var int |
||
16 | */ |
||
17 | protected $reattemptDelay = 0; |
||
18 | |||
19 | /** |
||
20 | * @var DateTimeImmutable |
||
21 | */ |
||
22 | protected $createdAt; |
||
23 | |||
24 | 2 | public function __construct() |
|
28 | |||
29 | /** |
||
30 | * @return int |
||
31 | */ |
||
32 | 3 | public function maxAttempts(): int |
|
36 | |||
37 | /** |
||
38 | * @param int $maxAttempts |
||
39 | */ |
||
40 | public function setMaxAttempts(int $maxAttempts): void |
||
44 | |||
45 | /** |
||
46 | * @return int |
||
47 | */ |
||
48 | 1 | public function reattemptDelay(): int |
|
52 | |||
53 | /** |
||
54 | * @param int $reattemptDelay |
||
55 | */ |
||
56 | public function setReattemptDelay(int $reattemptDelay): void |
||
60 | |||
61 | /** |
||
62 | * @return DateTimeImmutable |
||
63 | */ |
||
64 | 2 | public function createdAt(): DateTimeImmutable |
|
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | abstract public function jobRunner(): string; |
||
73 | } |
||
74 |