Move the _semaphore.WaitAsync into the CommandWithResult and CommandWithNoResult methods. The calling methods really should not have to know about this implementation detail.
As a bonus, this allows the awaits to be removed from the calling methods and thus one level of async state machine.
Move the _semaphore.WaitAsync into the CommandWithResult and CommandWithNoResult methods. The calling methods really should not have to know about this implementation detail. As a bonus, this allows the awaits to be removed from the calling methods and thus one level of async state machine.