AlexStocks commented on a change in pull request #1161:
URL: https://github.com/apache/dubbo-go/pull/1161#discussion_r615339126



##########
File path: registry/event_listener.go
##########
@@ -26,31 +26,38 @@ import (
 )
 
 // The Service Discovery Changed  Event Listener
-type ServiceInstancesChangedListener struct {
+type ServiceInstancesChangedListenerBase struct {
        ServiceName   string
        ChangedNotify observer.ChangedNotify
 }
 
 // OnEvent on ServiceInstancesChangedEvent the service instances change event
-func (lstn *ServiceInstancesChangedListener) OnEvent(e observer.Event) error {
+func (lstn *ServiceInstancesChangedListenerBase) OnEvent(e observer.Event) 
error {
        lstn.ChangedNotify.Notify(e)
        return nil
 }
 
 // Accept return true if the name is the same
-func (lstn *ServiceInstancesChangedListener) Accept(e observer.Event) bool {
+func (lstn *ServiceInstancesChangedListenerBase) Accept(e observer.Event) bool 
{
        if ce, ok := e.(*ServiceInstancesChangedEvent); ok {
                return ce.ServiceName == lstn.ServiceName
        }
        return false
 }
 
 // GetPriority returns -1, it will be the first invoked listener
-func (lstn *ServiceInstancesChangedListener) GetPriority() int {
+func (lstn *ServiceInstancesChangedListenerBase) GetPriority() int {
        return -1
 }
 
 // GetEventType returns ServiceInstancesChangedEvent
-func (lstn *ServiceInstancesChangedListener) GetEventType() reflect.Type {
+func (lstn *ServiceInstancesChangedListenerBase) GetEventType() reflect.Type {
        return reflect.TypeOf(&ServiceInstancesChangedEvent{})
 }
+
+type ServiceInstanceChangeListener interface {

Review comment:
       lizhixin




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to