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

Allow configuration of outbound substream in OneShotHandler #1521

Merged
merged 2 commits into from
Apr 1, 2020

Conversation

sireliah
Copy link
Contributor

@sireliah sireliah commented Mar 25, 2020

When opening a new outbound substream in OneShotHandler, you should be able to specify the timeout for the substream.

Follow up of discussion here: #1512

Do you like this solution or do you prefer the .with_substream_timeout(timeout) way?

swarm/src/protocols_handler/one_shot.rs Outdated Show resolved Hide resolved
@sireliah sireliah force-pushed the oneshot-substream-timeout branch 2 times, most recently from ff3c88c to 80ac068 Compare March 26, 2020 22:16
@sireliah sireliah requested a review from tomaka March 28, 2020 16:33
Copy link
Member

@tomaka tomaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nits

swarm/src/protocols_handler/one_shot.rs Show resolved Hide resolved
swarm/src/protocols_handler/one_shot.rs Outdated Show resolved Hide resolved
swarm/src/protocols_handler/one_shot.rs Outdated Show resolved Hide resolved
swarm/src/protocols_handler/one_shot.rs Outdated Show resolved Hide resolved
@tomaka tomaka merged commit 6b4bdc1 into libp2p:master Apr 1, 2020
@romanb
Copy link
Contributor

romanb commented Apr 1, 2020

I may be blind, but how does one now actually configure a OneShotHandlerConfig? I only see private fields and a Default impl.

@romanb
Copy link
Contributor

romanb commented Apr 1, 2020

Moreover, the one_shot is a private module and OneShotHandlerConfig is not re-exported by protocols_handler, which only leaves OneShotHandler::default() usable, since OneShotHandler::new requires a OneShotHandlerConfig. I'm a bit puzzled.

@sireliah sireliah deleted the oneshot-substream-timeout branch April 1, 2020 18:36
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.

3 participants