Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about implementing custom PubSubRouter #187

Open
opaolini opened this issue May 28, 2019 · 3 comments
Open

Question about implementing custom PubSubRouter #187

opaolini opened this issue May 28, 2019 · 3 comments
Labels
kind/support A question or request for support

Comments

@opaolini
Copy link

opaolini commented May 28, 2019

Greetings!

I am currently implementing a custom Router outside of context of pubsub package that uses some types outside of the scope of pubsub.

The last thing I am missing is grabbing the message channel for a particular peer. In floodsub and gossipsub it's done like so:

	mch, ok := gs.p.peers[p]
	if !ok {
		return
	}

The problem in my custom one is that *PubSub's field peers is unexported and I am unable to do so.

Is it currently possible for me to implement a custom Publish outside of the scope of this package (and not trying to use reflect or anything)?

Thanks!

@vyzo
Copy link
Collaborator

vyzo commented May 28, 2019

It is a little more complicated than that, but we are aware that there is a need to implement routers outside the library.
We will work to address the issue in the not-so-distant future.

@whyrusleeping
Copy link
Contributor

@vyzo could you elaborate a little more on the work required to allow for this? I'd love to see external routers written, and i'm sure people wanting to write them would be happy to help make it possible

@vyzo
Copy link
Collaborator

vyzo commented Sep 23, 2019

#199 performs the necessary refactoring; it should be sufficient to implement out of tree routers.

@daviddias daviddias added the kind/support A question or request for support label Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support A question or request for support
Projects
None yet
Development

No branches or pull requests

4 participants