Unfold¶
Generates a sequence of messages from a single message based on a custom generator function
- class arroyo.processing.strategies.unfold.Unfold(generator: Callable[[TInput], Iterable[BaseValue[TOutput]]], next_step: ProcessingStrategy[FilteredPayload | TOutput])¶
Unfold receives a message and explodes it to generate a collection of messages submitting them one by one to the next step. The generated messages are created according to the generator function provided by the user.
The generator function provided must return an iterable (i.e. a class that implements __iter__ ).
If this step receives a MessageRejected exception from the next step it keeps the remaining messages and attempts to submit them on subsequent calls to poll