Nexus will refer broadcast event request

This commit is contained in:
LittleSheep 2024-10-27 12:54:39 +08:00
parent 6645a60b30
commit 26a9e62a17

View File

@ -99,3 +99,16 @@ func (v *ServiceRpcServer) RemoveService(ctx context.Context, request *proto.Rem
IsSuccess: err == nil, IsSuccess: err == nil,
}, nil }, nil
} }
func (v *ServiceRpcServer) BroadcastEvent(ctx context.Context, in *proto.EventInfo) (*proto.EventResponse, error) {
services := ListServiceInstance()
for _, service := range services {
conn, err := service.GetGrpcConn()
if err != nil {
continue
}
_, _ = proto.NewDirectoryServiceClient(conn).BroadcastEvent(ctx, in)
}
return &proto.EventResponse{}, nil
}