robocanic commented on code in PR #1455:
URL: https://github.com/apache/dubbo-admin/pull/1455#discussion_r3106221866
##########
pkg/config/app/admin.go:
##########
@@ -115,7 +120,7 @@ func (c AdminConfig) PostProcess() error {
)
}
-func (c AdminConfig) Validate() error {
+func (c *AdminConfig) Validate() error {
Review Comment:
Suggestion: 这里的receiver需要统一
<img width="1931" height="373" alt="Image"
src="https://github.com/user-attachments/assets/7dcefec0-70e2-44ea-9ad9-fc7f74d0e375"
/>
##########
pkg/core/events/async.go:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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 events
+
+import "sync/atomic"
+
+type AsyncSubscriber interface {
+ Subscriber
+ AsyncEnabled() bool
Review Comment:
Discussion:
这个AysncEnabled()直接移到Subscriber里面会不会更好?使用者可以根据自己的需求按需开启异步的事件订阅,然后component里面也可以少写一些类型断言和类型强转。另外,AysncEnabled()这个方法应该要写上详细的注释,如适用场景(需要在subscriber中执行时间比较长的逻辑),背后的逻辑(协程+channel)等。
--
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]