-
Notifications
You must be signed in to change notification settings - Fork 245
Add context to client #20
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
Conversation
| c.logger.Debug("seed", "addr", maddr.String()) | ||
| // TODO(tzdybal): configuration param for connection timeout | ||
| ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) | ||
| ctx, cancel := context.WithTimeout(c.ctx, 3*time.Second) |
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.
Should we extract 3*time.Second to some documented const or rather var?
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.
I was thinking about configuration TBH, but for now I'll just use const.
liamsi
left a comment
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.
Left some nit, otherwise LGTM!
|
I'll fix the nit in #17. |
|
Actually, I'll skip this one, as the changes are already included in #17. |
To enable control over client life-cycle, we need a context. It's also passed to libp2p layer.