-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Errors consumer polls producer #52
base: main
Are you sure you want to change the base?
Conversation
Also adds the ProducerError enum and raises MessageRejected if the producer queue is full.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a clarification about the plan for the producer otherwise it is ok
if let Err(ProducerError::QueueFull) = res { | ||
return Err(ProcessingError::MessageRejected); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to start using futures instead? The issue with this approach, I think, is that it puts you in a CPU tight loop while you wait for the message to be produced, while you can leave the CPU free by waiting on a fuiture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using futures might make more sense. But this is not actually a synchronous function currently and we are not waiting. It fires a delivery callback when it's done.
This reverts commit 3ef068d.
Also adds the ProducerError enum and raises MessageRejected
if the producer queue is full.