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::
2173
2173
}
2174
2174
}
2175
2175
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...
2178
2178
private function shouldFlush(): bool
2179
2179
{
2180
2180
return 100 <= \count($this->jobs);
2181
2181
}
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
+ }
2182
2189
}
2183
2190
2191
+ .. versionadded :: 6.3
2192
+
2193
+ The :method: `Symfony\\ Component\\ Messenger\\ Handler\\ BatchHandlerTrait::getBatchSize `
2194
+ method was introduced 6.3.
2195
+
2184
2196
.. note ::
2185
2197
2186
2198
When the ``$ack `` argument of ``__invoke() `` is ``null ``, the message is
You can’t perform that action at this time.
0 commit comments