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

Expose Dialer #10

Open
cpacia opened this issue Sep 9, 2020 · 1 comment
Open

Expose Dialer #10

cpacia opened this issue Sep 9, 2020 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@cpacia
Copy link

cpacia commented Sep 9, 2020

Once the dialer has been created provide a way for the user to access it so they can use it for other connections (for example, http).

Not sure the best way here. Possibly by returning the dialer from NewBuilder() or maybe via an option where the user passes in a pointer to the dialer and the contructor sets it. Either way it's a little awkward, but useful functionality.

@moul moul added the enhancement New feature or request label Sep 9, 2020
@Jorropo
Copy link
Collaborator

Jorropo commented Sep 9, 2020

Once the dialer has been created provide a way for the user to access it so they can use it for other connections (for example, http).

Not sure the best way here. Possibly by returning the dialer from NewBuilder() or maybe via an option where the user passes in a pointer to the dialer and the contructor sets it. Either way it's a little awkward, but useful functionality.

Thx for pointing this.
This is totally possible but would complicate a bit the life cycle of the tor node (it would need to probably have a ref counter or something of this kind because you don't want to loose your tor node when libp2p closes if you are using it elsewhere).
I think the most simple way is to create a new NewBuilder, like NewBuilderWithDialer.
I find using a call back or a pointer in an option not intuitive but it have a very strong point, wich is it's modular AF, in the future with more returns option (like resolver) more Builders could become a mess (I guess in this case there will be an easy NewBuilder and a FullNewBuilder with all returns options).

@Jorropo Jorropo added this to the 1.1 milestone Sep 9, 2020
@moul moul modified the milestones: 1.1, 1.0 Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants