Async backlog by mgravell · Pull Request #1612 · StackExchange/StackExchange.Redis

Conversation

@mgravell

See also #1574; rather than buffering (which helps, but just kicks the problem down a little), this moves ProcessBacklog to be truly async; it also checks for work before attempting to acquire the lock, to short-circuit high contention scenarios

- make the backlog processor async
- check for work *before* trying to get the lock

NickCraver

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Much cleaner too

@ghost

@mgravell Just for curiosity, why are you using lock inside an async method instead of an async-friendly construct?

@IgorIgorevich94

@mgravell Just for curiosity, why are you using lock inside an async method instead of an async-friendly construct?

I would assume that there is no point in introducing additional async overhead here, since there is no IO or Network stuff happening inside the lock code block.