Open TmLev opened 3 years ago
Not directly, aside from using something like tokio::task::spawn_blocking
of course. I'm not opposed to some deeper async integration, but it's not something that I'm expecting to implement soon
Closing this out as it's not something I'm expecting to do any time soon. I'd be open to a pull request for this, although it would likely only be applicable to some backends, since e.g. sqlite is always going to be based on libsqlite which isn't async-aware.
The sqlite backend would still have to expose async methods that do something like spawn_blocking
.
@ibraheemdev sure, but the consumer of Butane could just as well make the spawn_blocking calls themselves. That's the same approach taken with Diesel, as in this Actix Web example https://actix.rs/docs/databases/.
Yeah, I was just saying that if you wanted to expose an async API, ideally everything should be usable directly in an async context.
Reactivating as this is under active consideration
I've merged master into the latest async branch , disabling r2d2
feature.
https://github.com/jayvdb/butane/tree/async-no-r2d2-jv-merge-master
@jayvdb remind me what is the intended difference between that branch and async-wip
? That also has r2d2 currently disabled.
I've just added async_checklist.md to attempt to track the remaining work on that branch.
I think I removed r2r2 from the features list so that I could use --all-features
, and it has a recent master
merged into it.
https://github.com/nvksv/maybe-async-cfg/pull/4 has been merged and released, which we can use on the butane branch to reduce the dependencies.
Is it possible to use
butane
with asynchronous runtime like, for example,tokio
?