Change order of join function for clarity

This commit is contained in:
James Ray
2019-01-24 15:07:39 +11:00
committed by GitHub
parent 3482f357b8
commit c04a758503

View File

@@ -234,11 +234,11 @@ delay in the overlay with some healthy margin.
Topic membership is controlled by two operations supported by the
router, as part of the pubsub api:
- On `JOIN(topic)` the router joins the topic. In order to do so, it
selects `D` peers from `peers.gossipsub[topic]`, adds them to `mesh[topic]`
and notifies them with a `GRAFT(topic)` control message. If it already has
`fanout` peers in the topic, then it selects those peers as the
initial mesh peers.
- On `JOIN(topic)` the router joins the topic. In order to do so, if it already has
`D` peers from the `fanout` peers of a topic, then it adds them to `mesh[topic]`,
and notifies them with a `GRAFT(topic)` control message. Otherwise, it
selects `D` peers from `peers.gossipsub[topic]`, and likewise adds them to
`mesh[topic]` and notifies them with a `GRAFT(topic)` control message.
- On `LEAVE(topic)` the router leaves the topic. It notifies the peers in
`mesh[topic]` with a `PRUNE(topic)` message and forgets `mesh[topic]`.