Modern data access libraries are migrating to async methods in their API. For example, updated MongoDB driver rewritten with async support.
On the other hand, HangFire have synchronous API for internal objects like IStorageConnection, IFetchedJob, IMonitoringApi, IWriteOnlyTransaction and so on.
It forces to use workarounds like AsyncHelper to build custom storage for HangFire.
So my suggestion is to update API in async way (e.g. return Task<TResult> instead of TResult).
Modern data access libraries are migrating to async methods in their API. For example, updated MongoDB driver rewritten with async support.
On the other hand, HangFire have synchronous API for internal objects like
IStorageConnection,IFetchedJob,IMonitoringApi,IWriteOnlyTransactionand so on.It forces to use workarounds like AsyncHelper to build custom storage for HangFire.
So my suggestion is to update API in async way (e.g. return
Task<TResult>instead ofTResult).