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

Extend feature-flags to allow choosing runtime for libp2p-tcp #1471

Merged
merged 4 commits into from
May 18, 2020

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Feb 26, 2020

This patch changes the feature flags in the root Cargo.toml to allow choosing which runtime to use for the libp2p-tcp implementation.

@thomaseizinger

This comment has been minimized.

@thomaseizinger thomaseizinger force-pushed the tcp-feature-flagged branch 6 times, most recently from 82ff15d to 9f8cce0 Compare March 3, 2020 22:21
@thomaseizinger thomaseizinger force-pushed the tcp-feature-flagged branch 3 times, most recently from dd537f6 to 47afe64 Compare March 30, 2020 03:28
@thomaseizinger thomaseizinger marked this pull request as ready for review March 30, 2020 03:32
@thomaseizinger
Copy link
Contributor Author

@tomaka This is ready for review / input from my side :)

@jeromegn
Copy link

We'd very much like this as well. Adding async-std is a big dependency because we're already using tokio.

@vorot93
Copy link
Contributor

vorot93 commented May 11, 2020

Yeah, this PR being reviewed and merged is long overdue.

@tomaka
Copy link
Member

tomaka commented May 11, 2020

Adding async-std is a big dependency because we're already using tokio.

To be clear, it's already possible to not depend on async-std but depending on libp2p-tcp explicitly and adding default-features = false.

I would gladly accept the changes that this PR makes to the root Cargo.toml. The fact that it's impossible to disable async-std directly from the libp2p facade crate is clearly an overlook.

However the changes in libp2p-tcp itself and in particular the module path change are pure bikeshedding to me.

@jeromegn
Copy link

jeromegn commented May 11, 2020 via email

@thomaseizinger
Copy link
Contributor Author

Adding async-std is a big dependency because we're already using tokio.

To be clear, it's already possible to not depend on async-std but depending on libp2p-tcp explicitly and adding default-features = false.

I would gladly accept the changes that this PR makes to the root Cargo.toml. The fact that it's impossible to disable async-std directly from the libp2p facade crate is clearly an overlook.

However the changes in libp2p-tcp itself and in particular the module path change are pure bikeshedding to me.

Thanks for the feedback!
Based on that, I am gonna split what we seem to have consensus on (the root Cargo.toml changes) into a dedicated PR.

@thomaseizinger thomaseizinger changed the title Replace the macro in libp2p-tcp with a generic, inner implementation Extend feature-flags to allow choosing executor for libp2p-tcp May 12, 2020
@thomaseizinger thomaseizinger changed the title Extend feature-flags to allow choosing executor for libp2p-tcp Extend feature-flags to allow choosing runtime for libp2p-tcp May 12, 2020
@thomaseizinger
Copy link
Contributor Author

@tomaka Changes to the root Cargo.toml have been split out :)

To clarify this:

However the changes in libp2p-tcp itself and in particular the module path change are pure bikeshedding to me.

Are you generally opposed to both of these changes?
The codegen! macro is still bugging me :D

Would you be willing to merge the "generics" approach while keeping the public API of libp2p-tcp as-is? (i.e. no module path changes)

@tomaka
Copy link
Member

tomaka commented May 12, 2020

Are you generally opposed to both of these changes?

Would you be willing to merge the "generics" approach while keeping the public API of libp2p-tcp as-is? (i.e. no module path changes)

My honest opinion is that I don't see a solution based on a trait as better or more readable than a solution based on a macro. I'm not strictly opposed to this change, but I don't really have the motivation to review it, and I'm kept busy with other things which prevent me from properly answering that PR.

As for the PR as it is now, could you add an entry in the CHANGELOG mentioning the fact that the tcp feature is now tcp-async and tcp-tokio?

@thomaseizinger
Copy link
Contributor Author

My honest opinion is that I don't see a solution based on a trait as better or more readable than a solution based on a macro. I'm not strictly opposed to this change, but I don't really have the motivation to review it, and I'm kept busy with other things which prevent me from properly answering that PR.

That is fair, thank you for the reply and sorry for not separating the aspects of this PR more cleanly in the first place!

As for the PR as it is now, could you add an entry in the CHANGELOG mentioning the fact that the tcp feature is now tcp-async and tcp-tokio?

Will do!

@tomaka tomaka merged commit bbc6735 into libp2p:master May 18, 2020
@thomaseizinger
Copy link
Contributor Author

Uff, I completely forgot to add the changelog entry, sorry about that :(

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

Successfully merging this pull request may close these issues.

4 participants