A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/madelson/DistributedLock/issues/13 below:

Provider interface for SQL locks · Issue #13 · madelson/DistributedLock · GitHub

When using the library with IOC patterns it's often desirable to inject connection information separately from the type of lock or lock name. A centralized provider API would simplify this:

class SqlDistributedLockProvider
{
    // factory methods
    SqlDistributedLock CreateLock(string name);
    SqlDistributedLock CreateLockWithExactName(string name); // does not use GetSafeName()
    SqlDistributedReaderWriterLock CreateReaderWriterLock(string name);
    ...

    // we may also want to offer convenience methods for locking directly
    IDisposable TryAcquireExclusiveLock(string name, TimeSpan timeout, CancellationToken cancellationToken);
}

apoblock, stephenpatten and Chinh-P


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4