I have set up a path involving a map* stage, which most of the time needs to just transform one message into another, but I have a special case where one message must be transformed into a stream of several messages.
In more detail, I have an API defined where the structure of messages that my client dequeues from the channel is already specified. They notify the consumer about changes in the state of a system. But when a new consumer arrives, I want to replay the messages that are necessary for that consumer to initialize its copy of system's state.
Now, my map* stage is stateful: it remembers the current system state and suppresses duplicate messages (there is another filter* downstream that discards nil messages). That state is private to the map* stage, so I want that stage to be the source of all the state-establishing messages and want to trigger this by a special message that will be enqueued into the map* stage.
More generally, a stateful map*/filter* combination is very close to playing the role of an actor and I would like to leverage this fully. I'm sure my immediate goal could be realized by different routes, but this one seems the most elegant at the moment.