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

Add API to respond to bidirectional stream when getting next message from connection. #374

Closed
wants to merge 4 commits into from

Conversation

hansonkd
Copy link
Contributor

Hello,

I was building bindings for qp2p for Elixir and came across a case where i needed to not only accept the next message from a bidirectional stream, but also reply to it. I couldn't figure out a way with the current API to do this without having some type of correlation prefix on the message.

This PR adds a new method next_with_stream to ConnectionIncoming in order for users to respond to a bidirectional stream.

If you can accomplish this without these changes in the current API or if you have suggestions, please let me know!

Adds a new method `next_with_stream` to `ConnectionIncoming` in order
for users to respond to a bidirectional stream.
@hansonkd hansonkd requested a review from a team as a code owner February 22, 2022 17:18
Copy link
Member

@dirvine dirvine left a comment

Choose a reason for hiding this comment

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

A nice PR, thank you. This one makes a lot of sense.

@Yoga07
Copy link
Contributor

Yoga07 commented Feb 28, 2022

Hi @hansonkd ,

Thank you for your contribution. Adding a new API does make better sense than complicating using prefixes, meaning Users can call whichever API they want accordingly. It would be nice if you can get the failing rustfmt check here resolved and we'd be good for a merge.

Cheers!

@joshuef
Copy link
Contributor

joshuef commented Feb 28, 2022

also @hansonkd we follow conventional commits for commit messages to auto generate changelogs for release. So if you could reformat your messages to follow that it would be great 🙇

(eg: feat: add stream.. )

@joshuef
Copy link
Contributor

joshuef commented Apr 25, 2022

This has been superseded by #382 where I've tidied up the commit history and addressed the clippy issues w/r/t type complexity

@joshuef joshuef closed this Apr 25, 2022
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.

None yet

4 participants