1 | <?php |
||
16 | abstract class AbstractClient { |
||
17 | |||
18 | /** |
||
19 | * @var StreamInterface |
||
20 | */ |
||
21 | protected $stream; |
||
22 | |||
23 | /** |
||
24 | * @var LoggerInterface |
||
25 | */ |
||
26 | protected $log; |
||
27 | |||
28 | /** |
||
29 | * @param StreamInterface $stream |
||
30 | * @param LoggerInterface|null $log Logger instance. |
||
31 | */ |
||
32 | 39 | public function __construct(StreamInterface $stream, LoggerInterface $log = null) |
|
41 | |||
42 | |||
43 | /** |
||
44 | * Send request and retrieve response to the connected disque node. |
||
45 | * |
||
46 | * @param array $args |
||
47 | * @return array|int|null|string |
||
48 | * |
||
49 | * @throws CommandException |
||
50 | * @throws StreamException |
||
51 | */ |
||
52 | 30 | protected function send(array $args = []) |
|
59 | |||
60 | |||
61 | /** |
||
62 | * Map Disque's job responses to Job objects. |
||
63 | * |
||
64 | * @param array $list Job response array from the disque server. |
||
65 | * @return Job[] |
||
66 | */ |
||
67 | 8 | protected function mapJobs(array $list) { |
|
77 | } |
||
78 |