beiwei30 commented on a change in pull request #708:
URL: https://github.com/apache/dubbo-go/pull/708#discussion_r472224566



##########
File path: cluster/router/tag/tag_router.go
##########
@@ -76,21 +95,33 @@ func (c *tagRouter) Priority() int64 {
        return c.priority
 }
 
-// filterUsingStaticTag gets a list of invoker using static tag
-func filterUsingStaticTag(invokers []protocol.Invoker, url *common.URL, 
invocation protocol.Invocation) []protocol.Invoker {
-       if tag, ok := invocation.Attachments()[constant.Tagkey]; ok {
-               result := make([]protocol.Invoker, 0, 8)
-               for _, v := range invokers {
-                       if v.GetUrl().GetParam(constant.Tagkey, "") == tag {
-                               result = append(result, v)
+// Pool divided invokers into different address pool by tag.
+func (c *tagRouter) Pool(invokers []protocol.Invoker) (router.AddrPool, 
router.AddrMetadata) {
+       rb := make(router.AddrPool, 8)
+       for i, invoker := range invokers {
+               url := invoker.GetUrl()
+               tag := url.GetParam(constant.Tagkey, "")
+               if tag != "" {
+                       if _, ok := rb[tag]; !ok {

Review comment:
       done.




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