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

Use tokio-io length_delimited #154

Open
oberien opened this issue Aug 9, 2017 · 4 comments
Open

Use tokio-io length_delimited #154

oberien opened this issue Aug 9, 2017 · 4 comments

Comments

@oberien
Copy link
Collaborator

oberien commented Aug 9, 2017

Currently inside our codecs we write / read the length prefix and have logic to ensure that we only ever decode a full frame. Instead of manually taking care of it, we could use tokio-io's length_delimited, which will automatically length-prefix written messages and ensure to only ever pass full frames to the decoder.

@main--
Copy link
Owner

main-- commented Aug 9, 2017

Not possible, protobuf uses varints.

@main-- main-- closed this as completed Aug 9, 2017
@oberien
Copy link
Collaborator Author

oberien commented Aug 9, 2017

Couldn't someone™ create a PR to tokio-rs/tokio-io then to support protobuf's variants?

@main--
Copy link
Owner

main-- commented Aug 9, 2017

That would just be a different/new kind of abstraction. If we want it we can just do it here.

@oberien
Copy link
Collaborator Author

oberien commented Aug 10, 2017

This is possible once tokio-rs/tokio-io#64 is merged. A sample wip implementation can be found here.

@oberien oberien reopened this Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants