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

Compat for io #26

Open
MOZGIII opened this issue Feb 25, 2020 · 2 comments
Open

Compat for io #26

MOZGIII opened this issue Feb 25, 2020 · 2 comments

Comments

@MOZGIII
Copy link

MOZGIII commented Feb 25, 2020

I need a compat layer for io::AsyncWrite and io::AsyncRead. Can you add it?

@hawkw
Copy link
Member

hawkw commented Feb 25, 2020

@MOZGIII are you trying to adapt between tokio 0.1's Async{Read, Write} traits and tokio 0.2's? I'd definitely like to add this to tokio-compat; thanks for opening the issue.

In the meantime, a potential workaround is to use futures 0.3's io compat layer to turn tokio 0.1 AsyncRead and AsyncWrite into futures 0.3's versions, and then use tokio-util's compat module to convert the futures 0.3 AsyncRead/AsyncWrite traits into tokio 0.2's versions.

Of course, this is not ideal, and we should definitely provide a one-step compat layer here, but it'll work in the short term.

@MOZGIII
Copy link
Author

MOZGIII commented Feb 25, 2020

Thanks! I couldn't figure this out, this should work for my current use case.

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

No branches or pull requests

2 participants