-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(cluster): refactor sharded pub/sub v4 #2042
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
base: v4
Are you sure you want to change the base?
feat(cluster): refactor sharded pub/sub v4 #2042
Conversation
|
run sharded pub sub tests |
|
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.
❌ The following Jit checks failed to run:
- secret-detection-trufflehog
#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.
More info in the Jit platform.
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.
❌ The following Jit checks failed to run:
- secret-detection-trufflehog
#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.
More info in the Jit platform.
nkaradzhov
left a comment
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.
CLGTM, left couple totally unimportant nits
| this.onEnd = () => { | ||
| this.started = false; | ||
| this.emitter.emit("-node", this.instance, this.nodeKey); | ||
| }; | ||
|
|
||
| this.onError = (error: Error) => { | ||
| this.emitter.emit("nodeError", error, this.nodeKey); | ||
| }; | ||
|
|
||
| this.onMoved = () => { | ||
| this.emitter.emit("moved"); | ||
| }; |
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.
those all can be just instance arrow fns like this:
class Foo {
onEnd = () => {}
}this way we can remove the declarations
| this.instance.off("end", this.onEnd); | ||
| this.instance.off("error", this.onError); | ||
| this.instance.off("moved", this.onMoved); |
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.
its also ok to say this.instance.removeAllListeners(). I think it should be safe, because noone else uses the instance, so no danger of removing some listeners that are not ours
No description provided.