This method is called after an addition to a batch to determine the mode (REG, OOB or MIXED). However the mode is always (1 exception, see below) either REG or OOB (we can trash MIXED!):
- When a message list is received, we create a maximum of 2 batches: one with only regular, or another one with only OOB messages, or both
- The MaxOneThreadPerSender policy submits OOB batches to the thread pool, and only queues regular batches, so the same here: either reg or OOB batches are passed up
- NAKACK and UNICAST pass OOB batches up directly, and only regular batches are added to the table -> this means only regular messages are passed up the stack
- EXCEPTION: when we create an OOB batch, the default is REG and thus we change the mode. However, this could easily be changed by creating a batch with OOB mode already set
Note that determining the mode unnecessarily after each addition to a batch has a linear cost, as we're iterating through the entire batch! This is an unneeded/unwanted cost, especially for large batches!