message-bus icon indicating copy to clipboard operation
message-bus copied to clipboard

When is it used?

Open 0xc9e36 opened this issue 5 years ago • 1 comments

Your code is great, but I don't know how to use it. Is there a real application scenario?

0xc9e36 avatar Aug 30 '19 05:08 0xc9e36

The most simple example that comes to my mind would be using message-bus as an event bus with event sourcing patter.

Imagine having a large scale application containing a lot of components interacting with each other, and you want a way to make your components communicate while maintaining loose coupling and separation of concerns principles, the Event Bus pattern can be a good solution for your problem. https://dzone.com/articles/design-patterns-event-bus

This is also how i use it https://github.com/vardius/go-api-boilerplate/tree/master/pkg/eventbus for my api boilerplate

another example would be implementing pubsub service.

Let me know if this answers your question.

vardius avatar Aug 30 '19 23:08 vardius