Similarityoung commented on code in PR #746:
URL: https://github.com/apache/dubbo-go-pixiu/pull/746#discussion_r2465048981


##########
pkg/adapter/llmregistry/registry/nacos/registry.go:
##########
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+       "github.com/nacos-group/nacos-sdk-go/clients"
+       "github.com/nacos-group/nacos-sdk-go/clients/naming_client"
+       nacosConstant "github.com/nacos-group/nacos-sdk-go/common/constant"
+       "github.com/nacos-group/nacos-sdk-go/vo"
+)
+
+import (
+       "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/common"
+       "github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/registry"
+       baseRegistry 
"github.com/apache/dubbo-go-pixiu/pkg/adapter/llmregistry/registry/base"
+       "github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+       "github.com/apache/dubbo-go-pixiu/pkg/common/util/stringutil"
+       "github.com/apache/dubbo-go-pixiu/pkg/model"
+)
+
+func init() {
+       registry.SetRegistry(constant.Nacos, newNacosRegistry)
+}
+
+type NacosRegistry struct {
+       *baseRegistry.BaseRegistry
+       nacosListener *listener
+       client        naming_client.INamingClient
+}
+
+func (n *NacosRegistry) DoSubscribe() error {
+       go n.nacosListener.WatchAndHandle()
+       return nil
+}
+
+func (n *NacosRegistry) DoUnsubscribe() error {
+       n.nacosListener.Close()
+       return nil
+}

Review Comment:
   奇怪,我当时还特地试了下是有这个方法的,可能是因为我用的 nacos sdk 是 v2 版本的,不过既然有取消订阅的逻辑应该就可以了。



-- 
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.

To unsubscribe, e-mail: [email protected]

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