LockProvider

Class representing a single lock server. connString is a complete SQL Server connection string, including credentials.

Constructors

ConstructorDescription
new(connString)
Signature: connString:string -> LockProvider

Instance members

Instance memberDescription
AwaitEnvironmentLock(...)
Signature: (lockId:string * organisation:string * environment:string * maxDuration:TimeSpan * timeOut:TimeSpan) -> Lock

As EnvironmentLock, but waiting until timeOut or the lock is available

AwaitGlobalLock(...)
Signature: (lockId:string * maxDuration:TimeSpan * timeOut:TimeSpan) -> Lock

As GlobalLock, but waiting until timeOut or the lock is available

AwaitOneOf(getLock, lockIds, timeOut)
Signature: (getLock:Func<'t,Lock> * lockIds:seq<'t> * timeOut:TimeSpan) -> Lock
Type parameters: 't

Build a System.Func that returns a lock based on lockId and provide a list of lockIds. If any of the locks are available, it will pick one of the available locks at random. If none are available it will wait until one is, or timeOut has passed.

AwaitOrganisationLock(...)
Signature: (lockId:string * organisation:string * maxDuration:TimeSpan * timeOut:TimeSpan) -> Lock

As OrganisationLock, but waiting until timeOut or the lock is available

EnvironmentLock(...)
Signature: (lockId:string * organisation:string * environment:string * maxDuration:TimeSpan) -> Lock

Attempts to acquire an environment lock from the provider with the specified lockIdentifier. After maxDuration has elapsed the lock will become "stale" and will be automatically released to the next requester.

GlobalLock(lockId, maxDuration)
Signature: (lockId:string * maxDuration:TimeSpan) -> Lock

Attempts to acquire a global lock from the provider with the specified lockIdentifier. After maxDuration has elapsed the lock will become "stale" and will be automatically released to the next requester.

OneOf(getLock, lockIds)
Signature: (getLock:Func<'t,Lock> * lockIds:seq<'t>) -> Lock
Type parameters: 't

Build a System.Func that returns a lock based on lockId and provide a list of lockIds. If any of the locks are available, it will pick one of the available locks at random.

OrganisationLock(...)
Signature: (lockId:string * organisation:string * maxDuration:TimeSpan) -> Lock

Attempts to acquire an organisation lock from the provider with the specified lockIdentifier. After maxDuration has elapsed the lock will become "stale" and will be automatically released to the next requester.

Fork me on GitHub