Open willbuckner opened 1 year ago
I liked the approach from zbus moving from synchronous to asynchronous. They moved the library to asynchronous and introduced a blocking wrapper for the synchronous use case.
This should enable us to move to asynchronous while having minimal impact to synchronous implementations.
Having this library block makes it a bit frustrating to work with from within an async actix_web API. Sure, we can use it inside a
web::block()
, but currently even the builder code can't run in an async context, making dependency injection a bit tricky. Given that we're already usingreqwest
to interact with Jira, I think it wouldn't be too hard to interact with Jira asynchronously.I'm not sure whether others have use cases that depend on blocking code, but if so, we could have both a
Jira
and anAsyncJira
(perhaps gated by a crate feature). I wanted to get some feedback on the high level approach before possibly sending a PR--would having both an async client and a blocking client be preferred, or would you be open to making the entire library asynchronous and leaving it up to callers to provide a runtime (or are neither acceptable)? Thanks!