Make RedLock available in for scripting

Uncategorized

Implemented mechanism for using distributed lock in scripting. When Redis is enabled(multi server setup) redlock distributed lock will be used. When Redis is disabled ( single server setup )  named mutex lock will be used.
In both cases the code in scripting will be the same, no need to change it.
Example of using distributed lock in scripting:

using TenForce.Execution.Scripting.Common.Concurrency;

using (ILockObject locker = DistributedLockManager.Acquire("testlock"))
{
    if(locker.IsAcquired)
    {
      //Do some work that should be synchronised
    }
}

Also DistributedLockManager.Acquire supports second optional parameter - timeout to wait in milliseconds to aquire lock.