ThreeDotsLabs / watermill

Building event-driven applications the easy way in Go.
https://watermill.io
MIT License
6.87k stars 365 forks source link

Add no subscribers fallback option to GoChannel Pub/Sub #418

Open annismckenzie opened 5 months ago

annismckenzie commented 5 months ago

I needed a way to listen to any message sent via the GoChannel Pub/Sub that didn't have a subscriber yet. This was mainly used for debugging but it could be useful for other purposes as well.

I made sure to add a test and left the rest of the tests untouched – the test suite is passing.

Would you be open to accepting this contribution? If so, I'd take another pass over the current implementation's comments, some would need updating (for example, That means if you send a message to a topic to which no subscriber is subscribed, that message will be discarded. – update: this is done ☑️).

annismckenzie commented 2 months ago

Just saw your review – thank you! I’ll take a closer look next week.

annismckenzie commented 2 months ago

Short update: I rebased and addressed your comments, see above. I also updated a couple comments as promised in the pull request description in 8808fd72d6f154d234c5af4ac281a946c0b7234e and this would be ready for another look.