Closed Nuhvi closed 1 year ago
Interesting! @kasperisager @andrewosh mb someone has a better api name? Not a huge fan of “child” as it’s not really a tree
@mafintosh I agree. Destroying a "child" won't destroy "deeper children", but at least they are all going to be destroyed once the "root" (the one Node that bootstrapped the DHT itself) is destroyed, so I don't know what to call that pattern.
clone()
is the best I got for now.
swarm.session()
?
What about hive
?
On Mon, May 23, 2022 at 2:12 AM Ar Nazeh @.***> wrote:
swarm.session() ?
— Reply to this email directly, view it on GitHub https://github.com/hyperswarm/hyperswarm/pull/107#issuecomment-1134223990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQFDKDPFIWLFR4WGHHQSTVLMOVBANCNFSM5WEAU4MQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
-- Sent from my iBerry MacPhone
The closest pattern I could find, but it is more relevant to memory sharing not networking https://en.wikipedia.org/wiki/Flyweight_pattern
Session is the closest to terminology we already use 👍
@mafintosh renamed
@Nazeh do you mind if I rebase? It's a really cool feature
Maybe the event could be called predestroy
so that way it's explicit that this is happening before actually destroying resources. It could be an opportunity to also emit once a close
event at the end, so it's consistent with all other libs
@LuKks don't mind at all.
I wasn't sure how to force-push on this PR, GitHub has some instructions but not very clear as it involves master
branch:
Step 1: From your project repository, check out a new branch and test the changes.
git checkout -b Nazeh-child-nodes master
git pull git@github.com:Nazeh/hyperswarm.git child-nodes
Step 2: Merge the changes and update on GitHub.
git checkout master
git merge --no-ff Nazeh-child-nodes
git push origin master
Seems riskier than just opening a new PR
closing this, #130 is further ahead.
Creating multiple Hyperswarm Peers/nodes is useful, but DHT bootstrapping is expensive, this PR tries to fix that.
This a long shot I know, and its not blocking anyone, but I thought it might be interesting to consider.
Inspired by
corestore.namespace()
API