@piet if you feel I have missed something, please point that out!
I can't really answer a question like "do I understand your usecase?" we can only talk until we both feel like we understand each other. Also, just because I read something, doesn't mean I understood what you ment, I can only react by my interpretation of that. Please don't assume that something I say is automatically right just because I wrote that code.
The things I am suggesting are all things that I think would be simple to add, or necessary to make it work right.
On that note, I've just realized that you can't just flipflop replicate.request
, because when you do replicate.request(id, false)
it will send a "I don't want id
signal" (-1
) and that will screw with with request-skipping, because if you disconnect with the remote during the -1 state, they will remember that you don't want that feed and not mention it next time. (this may break eventual consistency - there are loads of tests in ebt to catch things like this)
Instead, we want to send a the signal that we do what that feed, but not right now! This is already sent if you are getting it faster from another peer. See the code in epidemic-broadcast-trees/v3.js
(and v2.js
was the old way to encode that). for example, epidemic-broadcast-trees/events.js
timeout (line 390) checks if we are expecting messages on a feed but havn't got them, and cycles to another peer for that feed. it calls setNotes(peer, feed, seq, rx)
to tell peer
that we do (rx=true
) or do not (rx=false
) want to receive feed
from them, but that we are up to seq
.
To pause a feed, we just need to be able to set all peers to rx=false
for a given feed.