bloombloombloom / Bloom

A debug interface for AVR-based embedded systems development on GNU/Linux.
https://bloom.oscillate.io/
Other
64 stars 3 forks source link

Move away from event-based TargetController interface #25

Closed navnavnav closed 2 years ago

navnavnav commented 2 years ago

Currently, the TargetController component serves other components via an event-based mechanism; When another component (such as Insight or the DebugServer) needs to perform any action on the connected target or debug tool, the component will trigger an event and wait for the TargetController to respond.

This is a misuse of events. Events should not be triggered with the expectation of a response.

I would like to refactor the TargetController component and introduce a new inter-component interface that is not event-based. The new interface will be command-response based; The TargetController will receive and process commands and return the appropriate responses. Events can still be used within the TargetController, but just not as the inter-component interface.

Because the TargetController interface is already contained within the TargetControllerConsole class, I won't have to make any significant changes to other components within Bloom (because all of them use the TargetControllerConsole class to interface with the TargetController).

I will start on this once I have finished the refactoring of the GDB debug server (which will be very soon).

navnavnav commented 2 years ago

Made good progress on this last weekend. The underlying TargetController command-response mechanism is pretty much complete. Still have to convert the old events to commands and responses. I have already begun this process and tested the new commands (they work really well), but it will take some time before this is complete.

Oh, and there is still a lot of documentation to write.

navnavnav commented 2 years ago

Made some more good progress on this. The TargetController no longer uses an event-based interface! All of the old events have been converted into commands & responses. It's much cleaner and simpler now. The concept of correlation IDs in events has also been completely removed.

All that's left for this ticket is to write some documentation on the TargetController component. After that, the changes will be good to merge into the develop branch.

navnavnav commented 2 years ago

Development for this is complete. The changes have been merged into the develop branch. The new documentation only covers the TargetController basics, but it's enough for now. Can be found at https://github.com/navnavnav/Bloom/blob/develop/src/TargetController/README.md

Closing this now. These changes will be included in the v0.9.0 release. See the associated milestone for updates (https://github.com/navnavnav/Bloom/milestone/4).