File tree 1 file changed +18
-4
lines changed 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::
282
282
$this->filePath = $filePath;
283
283
}
284
284
285
- public function receive(callable $handler ): void
285
+ public function get( ): void
286
286
{
287
287
$ordersFromCsv = $this->serializer->deserialize(file_get_contents($this->filePath), 'csv');
288
288
289
289
foreach ($ordersFromCsv as $orderFromCsv) {
290
290
$order = new NewOrder($orderFromCsv['id'], $orderFromCsv['account_id'], $orderFromCsv['amount']);
291
+
292
+ $envelope = new Envelope($order);
291
293
292
- $handler(new Envelope($order) );
294
+ $handler($envelope );
293
295
}
296
+
297
+ return [$envelope];
298
+ }
299
+
300
+ public function ack(Envelope $envelope): void
301
+ {
302
+ // Add information about the handled message
294
303
}
295
304
296
- public function stop( ): void
305
+ public function reject(Envelope $envelope ): void
297
306
{
298
- // noop
307
+ // Reject the message if needed
299
308
}
300
309
}
301
310
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
+
302
316
Receiver and Sender on the same Bus
303
317
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304
318
You can’t perform that action at this time.
0 commit comments