hypercore-protocol / hypercore-next

Hypercore 10 is an append only log with multi-writer primitives built in.
MIT License
150 stars 15 forks source link

support replication sessions #91

Closed mafintosh closed 2 years ago

andrewosh commented 2 years ago

Does it matter if the remote is also replicating this core before the session is opened? Thinking about the corestore case where you'll replicate but the remote lacks the capability. In that case the core's lifecycle is still bound to the protocol stream's.

mafintosh commented 2 years ago

Ah that's a great point, it's tied to the remote lifecycle yes. However, if the remote "rejects" this core, hypercore already keeps it around if the remote opens it later (ie it's lifecycle is already implicitly tied to the remote). I think the solution is another method core.unreplicate(stream) where if the remote rejects it corestore could unreplicate it.

andrewosh commented 2 years ago

Yeah makes sense with the explicit unreplicate. Great to have this

mafintosh commented 2 years ago

Alpha 36