beiwei30 commented on a change in pull request #708:
URL: https://github.com/apache/dubbo-go/pull/708#discussion_r469706007
##########
File path: cluster/router/router.go
##########
@@ -50,3 +55,39 @@ type PriorityRouter interface {
// 0 to ^int(0) is better
Priority() int64
}
+
+// Poolable caches address pool and address metadata for a router instance
which will be used later in Router's Route.
+type Poolable interface {
+ // Pool created address pool and address metadata from the invokers.
+ Pool([]protocol.Invoker) (AddrPool, AddrMetadata)
+
+ // ShouldPool returns if it should pool. One typical scenario is a
router rule changes, in this case, a pooling
+ // is necessary, even if the addresses not changed at all.
+ ShouldPool() bool
Review comment:
ShouldPool is more accurate in my opinion. If a router receives a
changed rule, it should re-pool the whole address list into bitmaps. That the
reason why the router chain needs to ask each "Poolable" router should pool the
address.
----------------------------------------------------------------
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]