Interact::on_input
in async mode doesn't take Session as an argument
#16
Labels
Interact::on_input
in async mode doesn't take Session as an argument
#16
The issue is we can't
Send+Clone
&mut Self
forfuture
which will be spawned in handler.We need to use some kind of
mutex
but we can't use the one instd
because its blocking.We could chose a
tokio
implemetnation orasync-std
or something else and provide an argument asArc<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
The text was updated successfully, but these errors were encountered: