1 | <?php |
||
16 | class BeanstalkdAdapter extends Adapter |
||
17 | { |
||
18 | /** @var Pheanstalk */ |
||
19 | private $connection; |
||
20 | |||
21 | private $host; |
||
22 | private $port; |
||
23 | private $queue; |
||
24 | private $timeout; |
||
25 | private $persistent; |
||
26 | |||
27 | public function __construct( |
||
40 | |||
41 | /** |
||
42 | * Establish connection to the queue. |
||
43 | */ |
||
44 | public function connect(): void |
||
48 | |||
49 | /** |
||
50 | * Pull next job from the queue. |
||
51 | * |
||
52 | * @return Job|SerializableForQueue |
||
53 | */ |
||
54 | public function next(): ?Job |
||
68 | |||
69 | /** |
||
70 | * Push command onto the queue. |
||
71 | * |
||
72 | * @param Channel $channel |
||
73 | * @param Driver $driver |
||
74 | * @param Command $command |
||
75 | */ |
||
76 | public function push(Channel $channel, Driver $driver, Command $command): void |
||
85 | |||
86 | /** |
||
87 | * Push command onto the queue with a delay. |
||
88 | * |
||
89 | * @param Channel $channel |
||
90 | * @param Driver $driver |
||
91 | * @param Command $command |
||
92 | * @param int $delay |
||
93 | * |
||
94 | * @return mixed|void |
||
95 | */ |
||
96 | public function later(Channel $channel, Driver $driver, Command $command, int $delay): void |
||
105 | } |
||
106 |