Open benjaminweb opened 3 years ago
@benjaminweb Hi, thanks for the issue. It looks like actix-web 3.x is using the older 0.2 version of Tokio (via actix-rt 1.1.1).
You can set up actix-web 3.x to use an existing Tokio runtime as described here: https://github.com/actix/actix-web/issues/1283.
However, I haven't kept up with the latest in Tokio 1.x compatibility interfaces. You would probably need to wrap the Tokio 1.x runtime/LocalSet in a 0.2 compatibility wrapper before passing it to actix-rt.
Other options would be to use/wait for actix-web 4.x (looks like it is in beta currently), or see if actix-web 3.x can be set up to use the latest version of actix-rt (2.2).
SCOPE I want to create a project with actix-web and tiberius, using bb8-tiberius as pool being propagated through the application state of actix-web.
CODE TO REPRODUCE My current revision is https://github.com/benjaminweb/actix-bb8-tiberius/commit/b5a13bb9de35360bf2541ef1224cb8c618a066e7
CURRENT BEHAVIOUR
cargo run
raises a:EXPECTED BEHAVIOUR Considering pg as reference implementation, there is no dedicated tokio runtime necessary as it already happens inside a tokio runtime, that of actix_web: https://github.com/actix/examples/blob/master/database_interactions/pg/src/main.rs#L95-L124
Also, @pimeys hinted me that there would be no additional tokio runtime required. The present behaviour might be a potential bug.
@kardeiz, I appreciate your effort in resolving this issue.
Once working, I want to publish the project as a quick-starter boilerplate actix-web, tiberius (MSSQL).