-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
autorelay: Split libp2p.EnableAutoRelay into 2 functions #2022
Conversation
Provide two specific ways to enable the autorelay subsystem libp2p.EnableAutoRelayWithStaticRelays libp2p.EnableAutoRelayWithPeerSource
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.
One questions about the API. There's also a failing staticcheck check.
|
||
// WithMinInterval sets the minimum interval after which peerSource callback will be called for more | ||
// candidates even if AutoRelay needs new candidates | ||
func WithMinInterval(interval time.Duration) Option { |
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 is the minimum interval both a parameter to WithPeerSource
and a separate option here?
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 want to fix that, just wanted to confirm once if it's fine to change WithPeerSource method signature.
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.
fixed. Removed from WithPeerSource
5ad1707
to
11d8901
Compare
@marten-seemann addressed review comments. |
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.
LGTM. @MarcoPolo, could you have a look at this PR please? Just want to make sure we definitely get the API right this time.
Pushed a change to make the |
Co-authored-by: Marten Seemann <[email protected]>
Provide two specific ways to enable the autorelay subsystem libp2p.EnableAutoRelayWithStaticRelays
libp2p.EnableAutoRelayWithPeerSource
fixes: #1866