Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

PubSub abstraction API #68

Closed
vasco-santos opened this issue Jul 29, 2020 · 1 comment
Closed

PubSub abstraction API #68

vasco-santos opened this issue Jul 29, 2020 · 1 comment

Comments

@vasco-santos
Copy link
Member

vasco-santos commented Jul 29, 2020

Per discussion in libp2p/js-libp2p#720#pullrequestreview-456405724, I am creating this issue to discuss the pubsub abstraction and to find a good way of accessing/modifying pubsub components.

At first, looking into libp2p/js-libp2p/src/pubsub.js, I think that we should basically get rid of this and use the pubsub instance directly. The base pubsub class (hopefully interface-pubsub in the future) should handle the specificities that are handled by libp2p. Currently, someone needs to do node1.pubsub._pubsub.*, to access stuff that is not exposed. In addition, the current setup makes us replicate the API in libp2p unnecessarily.

Other than the above, we need to think how we can customize some behaviours, both from startup (configuration?) and in runtime. An example for this is the topicValidators.

cc @jacobheun @wemeetagain let me know what you think

@jacobheun
Copy link
Contributor

Yeah the abstraction isn't of much use and just convolutes things. The only valuable thing it really does is bind the event listeners and that should just be done on the pubsub interface. I'm not really concerned with all the old "is started" error logic, it should just go away imo.

Other than the above, we need to think how we can customize some behaviours

Users can setup the topicValidators after creation of libp2p and before startup so I'm not really concerned about that, and I think this is the case for the majority of pubsub configuration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants