Simple Distributed Lock with Redis (Demo)
$ PORT=<your port> REDIS_HOST=<your redis host> go run main.go- Make sure to hit the
/highendpoint first and subsequently hit the/low. The/highwill be the first request that acquire the lock and the/lowwill wait until the previous request is done or release the lock. If the second request still acquiring the lock and reach the maximum number of reties, it will return Error Status Locked [423]