---
# System prepended metadata

title: Untitled

---

Test document

`lease(read|write)` -- get exclusive access to a resource, either expiring after a duration or after you explicitly release it
    - option to wait until someone else's lease expirse, or just fail immediately if someone else holds the lease
    - option to specify a read-only or read-write lock

`unlease(id)` - reverse the `lease()` operation

`audit(id)` - get the history of the lease with the given ID




Service(Coordinator)          ---      Client()
                                  HTTPS POST svc.ms.com/request_lease?
{ 
  clientID=  xyxz&operation=read
  resource=resID
  
}
    
    
    Server side logic
If lease available
   return 200OK with header for timeout
else
    if the request is for read
        if existing lease is for all reads
         then return 200 OK with header for timeout
        else
          send 500 with a message "Not Available", also send the time to wait and request the lock again 
    else
       if the request is for write
                                  
                                  HTTP GET svc.ms.com/request_lease?clientID=  xyxz&operation=write
                                  
                                  
Bookkeeping
 Lease, ClientID