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

Interact::on_input in async mode doesn't take Session as an argument #16

Open
zhiburt opened this issue Sep 20, 2021 · 1 comment
Open
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@zhiburt
Copy link
Owner

zhiburt commented Sep 20, 2021

The issue is we can't Send+Clone &mut Self for future which will be spawned in handler.

We need to use some kind of mutex but we can't use the one in std because its blocking.
We could chose a tokio implemetnation or async-std or something else and provide an argument as Arc<Mutex<Session>>.

But in such case we bind the user with our chose which is sort of bad.

The possible solution is to ask user to provide an implementation of Mutex via given Fn() -> impl future::Future<Output=&mut Self> .
And I tried to follow this approach but... it didn't worked out.

So I open an issue as a reminder and just in case someone holds some thoughts.

issue #15

@zhiburt zhiburt added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 20, 2021
@zhiburt
Copy link
Owner Author

zhiburt commented Mar 5, 2023

wait for #![feature(impl_trait_in_fn_trait_return)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant