-
Notifications
You must be signed in to change notification settings - Fork 55
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
docs: public rendezvous procedure #1203
base: master
Are you sure you want to change the base?
Conversation
libp2p/protocols/rendezvous.nim
Outdated
await rdv.advertise(ns, ttl, rdv.peers) | ||
|
||
proc requestLocally*(rdv: RendezVous, ns: string): seq[PeerRecord] = | ||
## This procedure returns all the peers already registered on the | ||
## given namespace. This function is synchronous |
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 function is synchronous
Not sure this is necessary.
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.
Done.
libp2p/protocols/rendezvous.nim
Outdated
@@ -555,6 +560,10 @@ proc requestLocally*(rdv: RendezVous, ns: string): seq[PeerRecord] = | |||
proc request*( | |||
rdv: RendezVous, ns: string, l: int = DiscoverLimit.int, peers: seq[PeerId] | |||
): Future[seq[PeerRecord]] {.async.} = | |||
## This async procedure request discovers and returns peers for |
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.
request discovers
Is it a typo?
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.
Done.
libp2p/protocols/rendezvous.nim
Outdated
@@ -555,6 +560,10 @@ proc requestLocally*(rdv: RendezVous, ns: string): seq[PeerRecord] = | |||
proc request*( | |||
rdv: RendezVous, ns: string, l: int = DiscoverLimit.int, peers: seq[PeerId] |
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.
it's better to use a more descriptive name for the parameter than l
.
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.
Done.
@@ -646,6 +655,10 @@ proc unsubscribeLocally*(rdv: RendezVous, ns: string) = | |||
return | |||
|
|||
proc unsubscribe*(rdv: RendezVous, ns: string, peerIds: seq[PeerId]) {.async.} = | |||
## The async unsubscribe procedure removes peers from a namespace by | |||
## sending an "Unregister" message to each connected peer. The operation | |||
## is bounded by a timeout for unsubscribing from all peers. |
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.
Where is this timeout?
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.
Three changes on this PR:
advertise
from method to proc.Related to these comments: #1183 (comment), #1183 (comment) and #1183 (comment)