-
Notifications
You must be signed in to change notification settings - Fork 4
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
Redesign current architecture #21
Comments
@zabawaba99 I figured we have this issue here we can talk about the design here and use this. I've created a branch to get started on the work. Once we have something discussed here we can add changes and make a PR to track those changes |
From the brief discussion we had I put together an extremely rough sketch of the redesign might look like. OverviewThe concept would revolve around having an object that allows us to exchange messages between components (labeled Exchange in the image above). All components would register with the exchange and tell it what events it expects. ExchangeThe purpose of the exchange is to accept messages and route them to the appropriate consumer. File System WatcherThis component is in charge of watching the file system. Whenever a file is modified, it will send a message through the exchange to notify that the tasks should be run. Messages Sent
Messages Received
Task ExecutorThis component is in charge of running the Messages Sent
Messages Received
UIThis component is in charge of building and managing the terminal ui. It will register against the exchange and listen for messages telling it about the status of the processes running. Messages Sent
Messages Received
|
And alternative to the exchange would be to abstract components into interfaces something like: (I got a little lazy with the drawing 👯 )Where the top level are the interfaces and the lower level are implementations of said interface. This would allow us to create a This design would also allow us to plug and play components and keep the code modularized and clean. We can get into a bit more detail regarding this design if we choose to go with this one over the exchange. |
Created packages for each component and tied them together in the main class
Changes can be followed on https://github.com/Tonkpils/snag/tree/decouple |
Based off #18
It feels a bit odd having to pass something down from main, to the builder to a vow and then to a promise just to have verbose output.
The text was updated successfully, but these errors were encountered: