1 | <?php |
||
32 | final class FirehoseAdapter implements AdapterInterface |
||
33 | { |
||
34 | const BATCHSIZE_SEND = 100; |
||
35 | |||
36 | /** @var FirehoseClient */ |
||
37 | protected $client; |
||
38 | |||
39 | /** @var array */ |
||
40 | protected $options; |
||
41 | |||
42 | /** @var string */ |
||
43 | protected $deliveryStreamName; |
||
44 | |||
45 | /** |
||
46 | * @param FirehoseClient $client |
||
47 | * @param string $deliveryStreamName |
||
48 | * @param array $options - BatchSize <integer> The number of messages to send in each batch. |
||
49 | */ |
||
50 | 8 | public function __construct(FirehoseClient $client, $deliveryStreamName, array $options = []) |
|
56 | |||
57 | /** |
||
58 | * @param MessageInterface[] $messages |
||
59 | * |
||
60 | * @throws MethodNotSupportedException |
||
61 | */ |
||
62 | 1 | public function acknowledge(array $messages) |
|
70 | |||
71 | /** |
||
72 | * @param MessageInterface[] $messages |
||
73 | */ |
||
74 | public function reject(array $messages) |
||
75 | { |
||
76 | throw new MethodNotSupportedException( |
||
77 | 1 | __FUNCTION__, |
|
78 | $this, |
||
79 | 1 | $messages |
|
80 | 1 | ); |
|
81 | 1 | } |
|
82 | 1 | ||
83 | 1 | /** |
|
84 | * @param MessageFactoryInterface $factory |
||
85 | * @param int $limit |
||
86 | * |
||
87 | * @throws MethodNotSupportedException |
||
88 | */ |
||
89 | public function dequeue(MessageFactoryInterface $factory, $limit) |
||
97 | 3 | ||
98 | /** |
||
99 | 3 | * @param MessageInterface[] $messages |
|
100 | 3 | * |
|
101 | * @throws FailedEnqueueException |
||
102 | 3 | */ |
|
103 | 3 | public function enqueue(array $messages) |
|
139 | 1 | ||
140 | /** |
||
141 | 1 | * @param string $name |
|
142 | 1 | * @param mixed $default |
|
143 | 1 | * |
|
144 | 1 | * @return mixed |
|
145 | 1 | */ |
|
146 | protected function getOption($name, $default = null) |
||
150 | |||
151 | 1 | /** |
|
152 | * @throws MethodNotSupportedException |
||
153 | 1 | */ |
|
154 | 1 | public function purge() |
|
162 | |||
163 | /** |
||
164 | * @throws MethodNotSupportedException |
||
165 | */ |
||
166 | public function delete() |
||
174 | } |
||
175 |