-
Notifications
You must be signed in to change notification settings - Fork 3
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
Sending a message from a handler #16
Comments
@mludvig normally, this is done through constructor injection of the bus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use MessageBus in multi-threaded program where one thread (e.g. Button) sends a
ButtonMessage()
to the bus. Then I've got a Controller thread that's subscribed to theButtonMessage()
messages and receives it. In theController.handler()
it decides what to do with it and then sends another message, e.g.DisplayMessage()
with some payload back to themessagebus
which should be handled by the Display thread. At that point all the hell breaks loose, theController.handler()
starts to get called recursively, the DisplayMessage() is never delivered and in the end it all crashes.As a workaround I have to listen for the
ButtonMessage()
in Display which feels like an anti-pattern, the Display shouldn't care where the event comes from or the Button shouldn't need to know what kind ofDisplayMessage()
to send. It should all be glued together only in the Controller.It'd be great if:
Are there any plans to do that?
The text was updated successfully, but these errors were encountered: