-
-
Save dcomartin/3ae35ad5ededae8337c4e71a0d9bd2f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Acquire lock for OrderId (implementation varies) | |
| var distributedLock = new DistributedLock(); | |
| using var lease = await distributedLock.Acquire(cmd.OrderId); | |
| if (!lease.Acquired) return; // or wait | |
| var receipt = await paymentGateway.Charge(cmd.OrderId, cmd.Amount); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment