Hangfire.Redis.StackExchange
Hangfire.Redis.StackExchange copied to clipboard
Replace async Redis calls with sync ones
This is food for thought and invitation to discussion.
The library uses a mix of sync and async calls to Redis.
It's perfectly fine to use async calls in transactions. It's perfectly fine to use async calls with ContinueWith
.
However, there are situations, where the same code is use both in transactions, and sequentially, but those calls are used in synchronous methods and are not awaited. This way, it is [theoretically] possible that the non-awaited task will be disposed before it is completed.
This call, for example: https://github.com/marcoCasamento/Hangfire.Redis.StackExchange/blob/master/Hangfire.Redis.StackExchange/RedisFetchedJob.cs#L69-L79 should be synchronous in non-transactional mode.