...
Try to wait for a lock for a shared key and release it after operation is completed.
Code Block | ||
---|---|---|
| ||
$Cache.Set('myint', 4); var tokenValue = $Cache.Lock('myintmylock'); try { // Locked code block } finally{ $Cache.ReleaseLock('myintmylock',tokenValue); } |
Example
Code Block | ||
---|---|---|
| ||
$Cache.Set('myint', 4);// Wait for 30 seconds if already locked var tokenValue = $Cache.Lock('myintmylock', '00:00:30'); try { // Locked code block } finally { $Cache.ReleaseLock('myintmylock',tokenValue); } |