forked from doppar/queue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJobInterface.php
More file actions
71 lines (61 loc) · 1.26 KB
/
JobInterface.php
File metadata and controls
71 lines (61 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
namespace Doppar\Queue\Contracts;
interface JobInterface
{
/**
* Execute the job.
*
* @return void
*/
public function handle(): void;
/**
* Get the number of times the job may be attempted.
*
* @return int
*/
public function tries(): int;
/**
* Get the number of seconds before a job should be made available again after failure.
*
* @return int
*/
public function retryAfter(): int;
/**
* Handle a job failure.
*
* @param \Throwable $exception
* @return void
*/
public function failed(\Throwable $exception): void;
/**
* Get the queue name this job should be pushed to.
*
* @return string
*/
public function queue(): string;
/**
* Get the job delay in seconds.
*
* @return int
*/
public function delay(): int;
/**
* Get the job identifier.
*
* @return string|null
*/
public function getJobId(): ?string;
/**
* Set the job identifier.
*
* @param string $id
* @return void
*/
public function setJobId(string $id): void;
/**
* Get the timeout in seconds.
*
* @return int|null
*/
public function getTimeout(): ?int;
}