diff --git a/lib/broadway.ex b/lib/broadway.ex index ef65a74..3b2ab0b 100644 --- a/lib/broadway.ex +++ b/lib/broadway.ex @@ -814,10 +814,15 @@ defmodule Broadway do by `c:handle_message/3`. For example, if you need to query the database, instead of doing it once per message, you can do it on this callback. - The length of the list of messages received by this callback is based on - the `min_demand`/`max_demand` configuration in the processor. This callback - must always return all messages it receives, as `c:handle_message/3` is still - called individually for each message afterwards. + The length of the list of messages received by this callback is often based + on the `min_demand`/`max_demand` configuration in the processor but ultimately + it depends on the producer and the frequency data arrives. A pipeline that + receives one message per minute will most likely emit single element lists. + Producers which are push-based, rather than pull-based, such as + `BroadwayRabbitMQ.Producer`, are more likely to send messages as they appear. + + This callback must always return all messages it receives, as + `c:handle_message/3` is still called individually for each message afterwards. """ @callback prepare_messages(messages :: [Message.t()], context :: term) :: [Message.t()]