Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2173,14 +2173,26 @@ provided in order to ease the declaration of these special handlers::
}
}

// Optionally, you can redefine the `shouldFlush()` method
// of the trait to define your own batch size
// Optionally, you can either redefine the `shouldFlush()` method
// of the trait to define your own batch size...
private function shouldFlush(): bool
{
return 100 <= \count($this->jobs);
}

// ... or redefine the `getBatchSize()` method if the default
// flush behavior suits your needs
private function getBatchSize(): int
{
return 100;
}
}

.. versionadded:: 6.3

The :method:`Symfony\\Component\\Messenger\\Handler\\BatchHandlerTrait::getBatchSize`
method was introduced 6.3.

.. note::

When the ``$ack`` argument of ``__invoke()`` is ``null``, the message is
Expand Down