Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubbo-go路由接口的改进 #2283

Open
FinalT opened this issue Mar 29, 2023 · 5 comments
Open

dubbo-go路由接口的改进 #2283

FinalT opened this issue Mar 29, 2023 · 5 comments

Comments

@FinalT
Copy link
Member

FinalT commented Mar 29, 2023

在dubbo-go中,PriorityRouter接口定义了URL()方法,但在其实现类中,并没有能够传入这个url的方法,导致实现类的URL()方法只能返回空值,,而在工厂接口PriorityRouterFactory中,定义了NewPriorityRouter() 方法,并且在注释中描述了会带着url创建PriorityRouter,但参数中并没有url。

我认为在接口PriorityRouterFactory的NewPriorityRouter()这个方法中,应该加上url这个参数,并且在后续开发其他规则路由中,也需要这个url获取路由规则以及其他参数。

// dubbo-go/cluster/router/router.go

// PriorityRouterFactory creates priority router with url
type PriorityRouterFactory interface {
	// NewPriorityRouter creates router instance with URL
	NewPriorityRouter() (PriorityRouter, error)
}

// PriorityRouter routes with priority
type PriorityRouter interface {
	// Route Determine the target invokers list.
	Route([]protocol.Invoker, *common.URL, protocol.Invocation) []protocol.Invoker

	// URL Return URL in router
	URL() *common.URL

	// Priority Return Priority in router
	// 0 to ^int(0) is better
	Priority() int64

	// Notify the router the invoker list
	Notify(invokers []protocol.Invoker)
}
@tobehardest
Copy link

I'm a newbie, can I try it?

@xiaolibuzai-ovo
Copy link

Can I have a try?

@FinalT
Copy link
Member Author

FinalT commented Jun 7, 2023

Can I have a try?

Of course

@xiaolibuzai-ovo
Copy link

thinks,Please assign it to me and I will finish it as soon as possible

@AlexStocks
Copy link
Contributor

@FinalT 先跟 @georgehao [hao hong fan] 沟通下,不要上来着急改。这块代码是火山,很容易改出问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants