1 | <?php |
||
16 | class MongoJob extends Job implements JobContract |
||
17 | { |
||
18 | /** |
||
19 | * The database queue instance. |
||
20 | * |
||
21 | * @var MongoThreadQueue |
||
22 | */ |
||
23 | protected $database; |
||
24 | |||
25 | /** |
||
26 | * The database job payload. |
||
27 | * |
||
28 | * @var StdClass |
||
29 | */ |
||
30 | protected $job; |
||
31 | |||
32 | /** |
||
33 | * Create a new job instance. |
||
34 | * |
||
35 | * @param Container $container |
||
36 | * @param MongoThreadQueue $database |
||
37 | * @param StdClass $job |
||
38 | * @param string $queue |
||
39 | */ |
||
40 | public function __construct(Container $container, MongoThreadQueue $database, $job, $queue) |
||
47 | |||
48 | /** |
||
49 | * Delete the job from the queue. |
||
50 | */ |
||
51 | public function delete() |
||
59 | |||
60 | /** |
||
61 | * Get the number of times the job has been attempted. |
||
62 | * |
||
63 | * @return int |
||
64 | */ |
||
65 | public function attempts() |
||
69 | |||
70 | /** |
||
71 | * Check if job reserved |
||
72 | * |
||
73 | * @return bool |
||
74 | */ |
||
75 | public function reserved(): bool |
||
79 | |||
80 | /** |
||
81 | * Get reserved at time |
||
82 | * |
||
83 | * @return int |
||
84 | */ |
||
85 | public function reservedAt(): int |
||
89 | |||
90 | /** |
||
91 | * Get the job identifier. |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | public function getJobId(): string |
||
99 | |||
100 | /** |
||
101 | * Get the raw body string for the job. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getRawBody() |
||
109 | } |
||
110 |