-
Notifications
You must be signed in to change notification settings - Fork 336
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
Added ping functionality #51
Conversation
return c.pinging | ||
} | ||
|
||
func (c *Client) GetPingInterval() time.Duration { |
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.
exported method Client.GetPingInterval should have comment or be unexported
@@ -88,6 +152,14 @@ func (c *Client) Production() *Client { | |||
return c | |||
} | |||
|
|||
func (c *Client) IsPinging() bool { |
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.
exported method Client.IsPinging should have comment or be unexported
}() | ||
} | ||
|
||
func (c *Client) DisablePinging() { |
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.
exported method Client.DisablePinging should have comment or be unexported
return client | ||
} | ||
|
||
func (c *Client) EnablePinging(pingInterval time.Duration, pingError chan error) { |
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.
exported method Client.EnablePinging should have comment or be unexported
@gngeorgiev I copied this comment from #45 as the same applies.
Thanks |
@sideshow Thank you for the reply. Alright, so the As to where the feature is implemented - believe me, I spend a considerable amount of time trying to implement this feature on a lower level. I don't remember the specifics since a while passed since I worked on this, but simply not enough stuff were exposed so you can make it civilized. That's why in the end I had to implement it in the client. Sure, we can abstract this in some data structure outside the client and it will use it, this could make things better, I guess, but not perfect in any case. |
Yes the Dial callback will be called for each new connection. You could certainly hold on to these connections, but you also dont know when they are closed. I'm closing this issue, but have logged an issue/enhancement ticket around creating a better connection pool which could have this functionality #88 thanks |
This was not supposed to get here so soon, submitted it by mistake, but I am gonna leave it for discussion.