-
Notifications
You must be signed in to change notification settings - Fork 930
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
Address notification batch mode #741
Conversation
registry/directory/directory.go
Outdated
var oldInvokers []protocol.Invoker | ||
|
||
// in batch mode, it is safe to remove since we have the complete list of events. | ||
if events != nil && len(events) > 1 { |
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.
events != nil && len(events) > 1 ==> len(events) > 1
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.
done.
registry/protocol/protocol.go
Outdated
@@ -242,7 +242,12 @@ func newOverrideSubscribeListener(overriderUrl *common.URL, invoker protocol.Inv | |||
} | |||
|
|||
// Notify will be triggered when a service change notification is received. | |||
func (nl *overrideSubscribeListener) Notify(event *registry.ServiceEvent) { | |||
func (nl *overrideSubscribeListener) Notify(events ...*registry.ServiceEvent) { | |||
if events == nil || len(events) == 0 { |
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.
events == nil || len(events) == 0 ==> len(events) == 0
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.
done.
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.
Excellent, LGTM
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.
LGTM
Address notification batch mode # Conflicts: # registry/directory/directory.go
Address notification batch mode # Conflicts: # registry/directory/directory.go
Address notification batch mode
What this PR does:
Support address notification from registry center in batch mode, instead of omit from register center one by one. In this mode, we assume all events accumulated by registry center first, then registry center will notify the directory the complete list in batch mode.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: