Skip to content

Commit

Permalink
Update broadway.ex
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim authored Jan 19, 2024
1 parent 1897296 commit 98ccb52
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/broadway.ex
Original file line number Diff line number Diff line change
Expand Up @@ -817,10 +817,13 @@ defmodule Broadway do
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 messages rarely will most likely emit lists below the `min_demand`
value. Producers which are push-based, rather than pull-based, such as
`BroadwayRabbitMQ.Producer`, are more likely to send messages as they arrive
(which may skip batching altogether and always be single element lists).
receives messages rarely will most likely emit lists of length below the
`min_demand` value. Producers which are push-based, rather than pull-based,
such as `BroadwayRabbitMQ.Producer`, are more likely to send messages as they
arrive (which may skip batching altogether and always be single element lists).
In other words, this callback is simply a convenience for preparing messages,
it does not guarantee the messages will be accumulated to a certain length.
For effective batching processing, see `c:handle_batch/4`.
This callback must always return all messages it receives, as
`c:handle_message/3` is still called individually for each message afterwards.
Expand Down

0 comments on commit 98ccb52

Please sign in to comment.