I was remodelling the whole worker consumer situation in the notification service. It's a thought experiment, based on what I have learned, and am still struggling to.
But this seems definitely a better way to reason about it. The code is attached below. A generic representation
There are three files in this pattern:
- _producer.go
- _producer_consumer.go
- _consumer.go