Clean up go shadower
CGA1123 opened this issue ยท 2 comments
CGA1123 commented
A couple of points raised in review:
- Should the pubsub and channel be setup inside the dispatcher?
- Should the dispatcher and reporter also have Start/Stop functions?
- The pool doesn't knows about the reporter and pushes results into a channel which the reporter consumes, but the dispatcher knows about the reporter and the pool and just calls functions on both. Should (option 1) the pool also call a function on the reporter (requires moving the Result struct into the reporter), or (option 2) the dispatcher just pushes requests into a channel (without knowing about the pool)? Option 2 is interesting for decoupling the components, but option 1 is the more tradition approach on other languages and may make the flow of data more easy to follow. ๐ค
- Should the report function in main be inside the reporter? (Specially if the reporter has Start function). We could then have different implementations of a reporter, e.g. ConsoleReporter, WebReporter (this one could start a web server and show the stats in a webpage for example). I think here I am also being influenced by the name, we probably have two interfaces, e.g. one would be responsible for displaying the stats (Reporter), and one would be responsible for collecting the stats (ResultsCollector). ๐ค At the moment, the second one is called Reporter, but not sure if it is the best name. The first one is just implemented in the main file.
CGA1123 commented
I think i've addresed most of these in 2c9a43b although still no addition of a 'proper' reporter yet ๐
PChambino commented
Nice! Probably fine to close this now ๐ If the reporter thing is important it will come up again, the straightforward implementation looks good now and the Collector responsability and naming makes sense. ๐