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

Why async_connect_on requires Send on the Stream? #168

Open
vi opened this issue Mar 11, 2018 · 1 comment
Open

Why async_connect_on requires Send on the Stream? #168

vi opened this issue Mar 11, 2018 · 1 comment

Comments

@vi
Copy link
Member

vi commented Mar 11, 2018

Can't it just be single-threaded?

56 |         .async_connect_on(p4ws);
   |          ^^^^^^^^^^^^^^^^ `tokio_io::AsyncRead + 'static` cannot be sent between threads safely
@kpp
Copy link
Contributor

kpp commented May 1, 2019

See aef39b6

It could be !Send, because there is a tokio::current_thread::runtime, which accepts !Send futures, however with Send marker you can put the future on a multithreaded executor. So you can create two versions: single_threaded_async_connect_on and multi_threaded_async_connect_on, but do you really need it?

@tomaka correct me if I am wrong

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