Closed eutampieri closed 4 years ago
Right, the library requires Tokio 0.2. I don't think you can use a 0.2 future directly on a 0.3 runtime, you need to go through a compatibility layer. I'll push a 0.3 port on master soon.
Try 0.8.0, just published.
@eutampieri Does 0.8.0 work for you? If so, I'd like to close the issue.
If it’s not a problem I’ll try later today
So, my use case is to bind to an LDAP server inside an Actix-web route, but it doesn't work. The error now is
thread 'actix-rt:worker:0' panicked at 'there is no reactor running, must be called from the context of Tokio runtime', /Users/eugeniotampieri/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.3.1/src/io/driver/mod.rs:232:18
The code is
#[post("/login")]
pub async fn login(params: web::Form<LoginDetails>, sessions: SessionsRW) -> impl Responder {
let username = ¶ms.username;
let password = ¶ms.password;
if let Ok((conn, mut ldap)) = ldap3::LdapConnAsync::new(LDAP_ADDRESS).await {
ldap3::drive!(conn);
// do stuff
}
}
Well that's something else; did you integrate Actix-web and Tokio by way of actix_rt
, as seen, e.g., in actix/actix-web#1283? Note that the current version of actix_rt
requires Tokio 0.2, so you'll have to use ldap3
0.7 anyway.
Sorry, my bad
The following code produces this error: