You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the ButtonMessage() messages and receives it. In the Controller.handler() it decides what to do with it and then sends another message, e.g. DisplayMessage() with some payload back to the messagebus which should be handled by the Display thread. At that point all the hell breaks loose, the Controller.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 of DisplayMessage() to send. It should all be glued together only in the Controller.
It'd be great if:
we could send messages in a fire and forget mode - most of the time my senders don't care about the return values, especially not from other threads.
we could send new messages from message handlers - my Controller would then be the only thing that needs to know about all the other components and the messages they expect but the individual components won't have to have a clue.
Are there any plans to do that?
The text was updated successfully, but these errors were encountered:
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: