-
Notifications
You must be signed in to change notification settings - Fork 212
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
Suggest #5847 use singleton pattern #5862
Conversation
@@ -1,3 +1,4 @@ | |||
/* eslint-disable no-use-before-define */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice this line. One consequence of using the singleton pattern for entangled facets, as here, is that there are a lot more use-before-define, to the point that being warned about them is just a noisy distraction.
Thanks, I'll take a look. When I started looking into I may decide to just use a comment at the top, which calls out a list of the Kind obligations, in which case I can switch to |
A non-obvious property of my original version is that you could call
I think I'm going to apply this, but with one change. I think I'll move most of the code back into |
Good discussion. Since the successor code must revive all kinds, the successor author is gonna grep for all of them anyway. A comment at the top is a fine idea. What we (@Chris-Hibbert and I have been doing is to rename the enclosing abstraction, An additional reason for the rename is to signal that the first-crank constraint applies to it as well. Anything it is re-vivifying from the previous incarnation it must now do in the first crank. So this |
The assert(wakeupHandler, 'reschedule() without wakeupHandler'); With Even better, as a reviewer, when I see a Btw, our first effort, the ertp-service, went through exactly the same evolution. When I first coded it with defineDurableKind* I had a tangle of |
OMG, I had to read this several times to get it. That is interesting! I believe it is compatible with the change to vivifySingleton, and certainly requires that
Yes. Now that I understand, that is exactly the right thing to do. And never mind that at |
|
@warner , #5847 provides the perfect example for showing off the comparative simplicity of the singleton pattern.
@Chris-Hibbert the before-and-after here may be useful for the durability class.
@warner if you like this, feel free to merge it into your PR without need for further coordination. I mean this PR only as a review suggestion on #5847
Reviewers. be sure to "Hide whitespace" differences in github when reviewing.