Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow interacting with Engine and Service microservices via EventBus #22

Open
3 of 6 tasks
derevnjuk opened this issue Mar 6, 2023 · 0 comments
Open
3 of 6 tasks
Assignees
Labels
Size: epic The issue can lead to several PRs and should be broken down into Type: enhancement New feature or request.

Comments

@derevnjuk
Copy link
Member

derevnjuk commented Mar 6, 2023

The package should provide the ability to implement a custom event bus that lets clients subscribe to events, execute commands, publish, and receive events, as shown in the diagram above. It makes sense when we have to provide an implementation using several technologies, like RabbitMQ, Redis Stream, or Kafka.

type EventBus interface {
	EventDispatcher
	CommandDispatcher

	register(messageName string, handler EventHandler) error
	unregister(messageName string, handler EventHandler) error
}

The register and unregister methods are used to subscribe to events or unsubscribe from events. Both methods accept only a single argument. The argument is the integration event handler type that is to be executed when the bus receives that corresponding event.

type EventHandler interface {
	Handle(message Message) (any, error)
}
@derevnjuk derevnjuk added Size: epic The issue can lead to several PRs and should be broken down into Type: enhancement New feature or request. labels Mar 6, 2023
@derevnjuk derevnjuk self-assigned this Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: epic The issue can lead to several PRs and should be broken down into Type: enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

1 participant