Rename _start/_stop/_run_/_cleanup to use do_ prefix#1440
Rename _start/_stop/_run_/_cleanup to use do_ prefix#1440cburgdorf wants to merge 1 commit intoethereum:masterfrom
Conversation
2d9393d to
a1a84de
Compare
|
@pipermerriam I think elaborating on this pattern and settling on the |
| self.running = True | ||
| self._process = ctx.Process( | ||
| target=self._prepare_start, | ||
| target=self._preparedo_start, |
a1a84de to
7944483
Compare
We had a bunch of methods that we called _<something> not because they are considered private but mainly because <something> already exist where <something> calls _<something> behind the scenes (after performing other work). These methods are meant to be overwritten and hence in the classical sense of OOP can not be considered private anyway (e.g. wouldn't work in most statical typed languages). Also this has proven to be problematic for the documentation because private methods are by default not included in the generated docs (righfully so).
7944483 to
fffa769
Compare
|
Conceptually 👍 but I'm not sure I love the
such that |
|
No matter how you turn it, you want to have a method in the base class ( And we also want to document both methods. We want to document that there is And if you step away from this particular case, it becomes even clearer. You want the So both methods need to be non-private, and we also want to document both. |
|
I'm currently 👎 on the change, because it feels like we're patching up a problem rather than attacking it at it's root. If patching helps accomplish some urgent goal, I'm good with it. But it seems like the motivation here is to find our universal pattern for solving this problem, and I don't think this is it. (I guess I'm just restating: #1429 (comment) )
This is an assumption I would want us to question, when trying to find our pattern. If you look at a service subclass (say
An example solution might look like breaking the two entities into a few pieces: Roughly:
I'm certain there are problems with this design, otherwise I'd be pitching to use it now. I think it would take a little while to work out the full solution. It's just a starting point for discussion, and an example of attacking the root problem. (An example problem I think there is an initialization cycle in |
|
@carver I agree that there may be a solution that addresses the problem at the architectural level and your proposed solution may just be that. However, to me, it feels as if our CI just broke because So just renaming However, I don't wanna be stubborn about it. If you and @pipermerriam are 👎 on this quick fix, I'll convert this PR into an issue, restating the problem and its consequences so that we can address it with a different fix later. For the affected plugin code I will update |
|
I'm good with a stop-gap fix for anything with an immediate need. I think @carver analysis is probably a good starting point for someone to spin out a secondary implementation of the |
What was wrong?
We had a bunch of methods that we called
_<something>not because they are considered private but mainly because<something>already exist where<something>calls_<something>behind the scenes (after performing other work).These methods are meant to be overwritten and hence in the classical sense of OOP can not be considered private anyway (e.g. could not be private in most statically typed languages).
Also this has proven to be problematic for the documentation because private methods are by default not included in the generated docs (righfully so).
How was it fixed?
Changed
_prefix todo_prefixCute Animal Picture