Skip to content

kasyap1234/url-shortner-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

url-shortner-microservice

using sync mutex to prevent race condition

eg : imagine two requests for the same url example.com via 2 goroutines , assume count of url =0;

first goroutine will increment the counter by 1 ; updated count =1; second goroutine will also increment the counter by 1 ; updated count=1; without mutext , we will get udpdated count=1; because the second goroutine will also read the same initial value of count=0;

defer statements are eecuted when the function returns ; Screenshot from 2024-12-18 12-43-08 Screenshot from 2024-12-18 12-42-54

Releases

No releases published

Packages

No packages published

Languages