-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
add concurrency for client's HostClient map #1550
Conversation
What is the use case for this? |
I have a api gateway app. I just want to add concurrency for client's HostClient map. what's wrong with the code? |
client.go
Outdated
// GetHostClients return the map of Http HostClient | ||
func (c *Client) GetHostClients() map[string]*HostClient { | ||
return c.m | ||
} | ||
|
||
// GetHttpsHostClients return the map of Https HostClient | ||
func (c *Client) GetHttpsHostClients() map[string]*HostClient { | ||
return c.ms | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add these methods? Since m
and ms
are protected by mLock
it's impossible to use the return value of these functions in a safe way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is test code. I will delete it
Thanks! |
No description provided.