File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -2173,14 +2173,26 @@ provided in order to ease the declaration of these special handlers::
21732173 }
21742174 }
21752175
2176- // Optionally, you can redefine the `shouldFlush()` method
2177- // of the trait to define your own batch size
2176+ // Optionally, you can either redefine the `shouldFlush()` method
2177+ // of the trait to define your own batch size...
21782178 private function shouldFlush(): bool
21792179 {
21802180 return 100 <= \count($this->jobs);
21812181 }
2182+
2183+ // ... or redefine the `getBatchSize()` method if the default
2184+ // flush behavior suits your needs
2185+ private function getBatchSize(): int
2186+ {
2187+ return 100;
2188+ }
21822189 }
21832190
2191+ .. versionadded :: 6.3
2192+
2193+ The :method: `Symfony\\ Component\\ Messenger\\ Handler\\ BatchHandlerTrait::getBatchSize `
2194+ method was introduced 6.3.
2195+
21842196.. note ::
21852197
21862198 When the ``$ack `` argument of ``__invoke() `` is ``null ``, the message is
You can’t perform that action at this time.
0 commit comments