File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -282,23 +282,37 @@ do is to write your own CSV receiver::
282282 $this->filePath = $filePath;
283283 }
284284
285- public function receive(callable $handler ): void
285+ public function get( ): void
286286 {
287287 $ordersFromCsv = $this->serializer->deserialize(file_get_contents($this->filePath), 'csv');
288288
289289 foreach ($ordersFromCsv as $orderFromCsv) {
290290 $order = new NewOrder($orderFromCsv['id'], $orderFromCsv['account_id'], $orderFromCsv['amount']);
291+
292+ $envelope = new Envelope($order);
291293
292- $handler(new Envelope($order) );
294+ $handler($envelope );
293295 }
296+
297+ return [$envelope];
298+ }
299+
300+ public function ack(Envelope $envelope): void
301+ {
302+ // Add information about the handled message
294303 }
295304
296- public function stop( ): void
305+ public function reject(Envelope $envelope ): void
297306 {
298- // noop
307+ // Reject the message if needed
299308 }
300309 }
301310
311+ .. versionadded :: 4.3
312+
313+ The ``ReceiverInterface `` has been upgraded to act as most libraries
314+ does, be sure to adapt your existing code according to the newly added methods.
315+
302316Receiver and Sender on the same Bus
303317~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304318
You can’t perform that action at this time.
0 commit comments