memphis.py
memphis.py copied to clipboard
Add error handling for async produce
The current implementation for asynchronous production of messages doesn't provide an error handling mechanism. We could provide a callback function through the add_done_callback()
method to the tasks that checks the return status and either calls a user provided callback function OR adds the message and error information to a list that the user can check and process.
As part of this, we might to distinguish between recoverable and non-recoverable errors. If we hit a non-recoverable error, we might want to stop producing more messages.