diff --git a/.gitignore b/.gitignore index d4b26077..7e8d6cb6 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,5 @@ StyleCop.Cache packages/ credentials/ + +publish/ \ No newline at end of file diff --git a/DistributedLock.Core/DistributedLock.Core.csproj b/DistributedLock.Core/DistributedLock.Core.csproj index 2bb6ba2d..4779cea0 100644 --- a/DistributedLock.Core/DistributedLock.Core.csproj +++ b/DistributedLock.Core/DistributedLock.Core.csproj @@ -52,8 +52,8 @@ - + - + \ No newline at end of file diff --git a/DistributedLockCodeGen/ApiDocGenerator.cs b/DistributedLockCodeGen/ApiDocGenerator.cs new file mode 100644 index 00000000..10419fc5 --- /dev/null +++ b/DistributedLockCodeGen/ApiDocGenerator.cs @@ -0,0 +1,108 @@ +using Medallion.Shell; +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; + +namespace DistributedLockCodeGen +{ + internal class ApiDocGenerator + { + private const string DotNetPath = @"C:\Program Files\dotnet\dotnet.exe"; + private const string DocsFramework = "netstandard2.1"; + private const string DocsFolder = "docs"; + private const string ApiFolder = "api"; + + private static readonly Shell Shell = new( + options => options.ThrowOnError() + .Command(c => c.RedirectStandardErrorTo(Console.Error).RedirectTo(Console.Out)) + ); + + +#if RELEASE + [Test] +#endif + public async Task GenerateApiDocs() + { + var result = await Shell.Run(DotNetPath, new[] { "tool", "install", "DefaultDocumentation.Console", "-g" }, options: o => o.ThrowOnError(false)).Task; + Assert.That(result.ExitCode, Is.EqualTo(0).Or.EqualTo(1)); // 1 == already installed + + var tempDirectory = Path.Combine(Path.GetTempPath(), $"DistributedLockApiDocGen_{DateTime.UtcNow.Ticks}"); + try + { + Directory.CreateDirectory(tempDirectory); + await GenerateApiDocsAsync(tempDirectory); + } + finally + { + DeleteDirectoryIfExists(tempDirectory); + } + } + + private static async Task GenerateApiDocsAsync(string tempDirectory) + { + var publishDirectory = Path.Combine(CodeGenHelpers.SolutionDirectory, DocsFolder, ApiFolder); + DeleteDirectoryIfExists(publishDirectory); + + var linksPath = Path.Combine(tempDirectory, "links"); + Directory.CreateDirectory(linksPath); + + var contentPath = Path.Combine(tempDirectory, "output"); + Directory.CreateDirectory(contentPath); + + var projectDirectories = Directory.GetDirectories(CodeGenHelpers.SolutionDirectory, "DistributedLock.*") + .Where(d => !d.EndsWith(".Tests", StringComparison.OrdinalIgnoreCase) && !d.EndsWith("DistributedLock", StringComparison.OrdinalIgnoreCase)); + + for (var i = 0; i < 2; ++i) + { + foreach (var projectDirectory in projectDirectories) + { + await GenerateApiDocsAsync(projectDirectory); + } + } + + Directory.Move(contentPath, publishDirectory); + + async Task GenerateApiDocsAsync(string projectDirectory) + { + var projectName = Path.GetFileName(projectDirectory); + var binDirectory = Path.Combine(projectDirectory, "bin", "Release", DocsFramework); + var outputDirectoryPath = Path.Combine(contentPath, projectName); + + var config = new Dictionary + { + { "AssemblyFilePath", Path.Combine(binDirectory, projectName + ".dll") }, + { "DocumentationFilePath", Path.Combine(binDirectory, projectName + ".xml") }, + { "ProjectDirectoryPath", projectDirectory }, + { "OutputDirectoryPath", outputDirectoryPath }, + { "AssemblyPageName", "README" }, + { "GeneratedAccessModifiers", "Public,Protected,ProtectedInternal" }, + { "GeneratedPages", "Assembly,Namespaces,Types,Members" }, + { "LinksOutputFilePath", Path.Combine(linksPath, projectName + ".txt") }, + { "LinksBaseUrl", $"https://github.com/madelson/DistributedLock/tree/default-documentation/{DocsFolder}/{ApiFolder}/{projectName}/" }, + { "ExternLinksFilePaths", new string[] { Path.Combine(linksPath, "*.txt") } }, + { "FileNameFactory", "NameAndMd5Mix" }, + { "Markdown.IgnoreLineBreak", true }, + }; + + var configFilePath = Path.Combine(tempDirectory, projectName + "_config.json"); + File.WriteAllText(configFilePath, JsonSerializer.Serialize(config)); + + DeleteDirectoryIfExists(outputDirectoryPath); + await Shell.Run("defaultdocumentation", "-j", configFilePath).Task; + } + } + + private static void DeleteDirectoryIfExists(string directory) + { + if (Directory.Exists(directory)) + { + Directory.Delete(directory, recursive: true); + } + } + } +} diff --git a/DistributedLockCodeGen/DistributedLockCodeGen.csproj b/DistributedLockCodeGen/DistributedLockCodeGen.csproj index ebf81e62..6463b066 100644 --- a/DistributedLockCodeGen/DistributedLockCodeGen.csproj +++ b/DistributedLockCodeGen/DistributedLockCodeGen.csproj @@ -1,7 +1,8 @@  - netcoreapp3.1 + net6.0 + Latest false enable @@ -13,6 +14,7 @@ + diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock..ctor.5tADfQ9q5nXUDj477SWvHg.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock..ctor.5tADfQ9q5nXUDj477SWvHg.md new file mode 100644 index 00000000..ea3a5cb7 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock..ctor.5tADfQ9q5nXUDj477SWvHg.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') + +## AzureBlobLeaseDistributedLock(BlobContainerClient, string, Action) Constructor + +Constructs a lock that will lease a blob based on [name](AzureBlobLeaseDistributedLock..ctor.5tADfQ9q5nXUDj477SWvHg.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient,string,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).name 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient, string, System.Action).name') within the provided [blobContainerClient](AzureBlobLeaseDistributedLock..ctor.5tADfQ9q5nXUDj477SWvHg.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient,string,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).blobContainerClient 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient, string, System.Action).blobContainerClient'). + +```csharp +public AzureBlobLeaseDistributedLock(BlobContainerClient blobContainerClient, string name, System.Action? options=null); +``` +#### Parameters + + + +`blobContainerClient` [Azure.Storage.Blobs.BlobContainerClient](https://docs.microsoft.com/en-us/dotnet/api/Azure.Storage.Blobs.BlobContainerClient 'Azure.Storage.Blobs.BlobContainerClient') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock..ctor.PPb+8c/p7LTz4wSm4vPWGg.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock..ctor.PPb+8c/p7LTz4wSm4vPWGg.md new file mode 100644 index 00000000..5f95b451 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock..ctor.PPb+8c/p7LTz4wSm4vPWGg.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') + +## AzureBlobLeaseDistributedLock(BlobBaseClient, Action) Constructor + +Constructs a lock that will lease the provided [blobClient](AzureBlobLeaseDistributedLock..ctor.PPb+8c/p7LTz4wSm4vPWGg.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobBaseClient,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).blobClient 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobBaseClient, System.Action).blobClient') + +```csharp +public AzureBlobLeaseDistributedLock(BlobBaseClient blobClient, System.Action? options=null); +``` +#### Parameters + + + +`blobClient` [Azure.Storage.Blobs.Specialized.BlobBaseClient](https://docs.microsoft.com/en-us/dotnet/api/Azure.Storage.Blobs.Specialized.BlobBaseClient 'Azure.Storage.Blobs.Specialized.BlobBaseClient') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.Acquire.jrwmxrsi+eqzAdB3xMnaMw.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.Acquire.jrwmxrsi+eqzAdB3xMnaMw.md new file mode 100644 index 00000000..09dd930a --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.Acquire.jrwmxrsi+eqzAdB3xMnaMw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') + +## AzureBlobLeaseDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') +An [AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.AcquireAsync.ulCFSvmk3VUn6f5ebzKW9A.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.AcquireAsync.ulCFSvmk3VUn6f5ebzKW9A.md new file mode 100644 index 00000000..3b8bc5e6 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.AcquireAsync.ulCFSvmk3VUn6f5ebzKW9A.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') + +## AzureBlobLeaseDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.Name.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.Name.md new file mode 100644 index 00000000..34eaa9c3 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') + +## AzureBlobLeaseDistributedLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.TryAcquire.1mh2rZwMkBLLsl/Ri/nDJA.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.TryAcquire.1mh2rZwMkBLLsl/Ri/nDJA.md new file mode 100644 index 00000000..a9e82b02 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.TryAcquire.1mh2rZwMkBLLsl/Ri/nDJA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') + +## AzureBlobLeaseDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') +An [AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.TryAcquireAsync.h3ZvrsNxi9ZoUPGAFzUdCQ.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.TryAcquireAsync.h3ZvrsNxi9ZoUPGAFzUdCQ.md new file mode 100644 index 00000000..83d5fd08 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.TryAcquireAsync.h3ZvrsNxi9ZoUPGAFzUdCQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') + +## AzureBlobLeaseDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.md new file mode 100644 index 00000000..102f0c9d --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLock.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure') + +## AzureBlobLeaseDistributedLock Class + +Implements a [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') based on Azure blob leases + +```csharp +public sealed class AzureBlobLeaseDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 AzureBlobLeaseDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [AzureBlobLeaseDistributedLock(BlobBaseClient, Action<AzureBlobLeaseOptionsBuilder>)](AzureBlobLeaseDistributedLock..ctor.PPb+8c/p7LTz4wSm4vPWGg.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobBaseClient, System.Action)') | Constructs a lock that will lease the provided [blobClient](AzureBlobLeaseDistributedLock..ctor.PPb+8c/p7LTz4wSm4vPWGg.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobBaseClient,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).blobClient 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobBaseClient, System.Action).blobClient') | +| [AzureBlobLeaseDistributedLock(BlobContainerClient, string, Action<AzureBlobLeaseOptionsBuilder>)](AzureBlobLeaseDistributedLock..ctor.5tADfQ9q5nXUDj477SWvHg.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient, string, System.Action)') | Constructs a lock that will lease a blob based on [name](AzureBlobLeaseDistributedLock..ctor.5tADfQ9q5nXUDj477SWvHg.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient,string,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).name 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient, string, System.Action).name') within the provided [blobContainerClient](AzureBlobLeaseDistributedLock..ctor.5tADfQ9q5nXUDj477SWvHg.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient,string,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).blobContainerClient 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AzureBlobLeaseDistributedLock(BlobContainerClient, string, System.Action).blobContainerClient'). | + +| Properties | | +| :--- | :--- | +| [Name](AzureBlobLeaseDistributedLock.Name.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](AzureBlobLeaseDistributedLock.Acquire.jrwmxrsi+eqzAdB3xMnaMw.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](AzureBlobLeaseDistributedLock.AcquireAsync.ulCFSvmk3VUn6f5ebzKW9A.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](AzureBlobLeaseDistributedLock.TryAcquire.1mh2rZwMkBLLsl/Ri/nDJA.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](AzureBlobLeaseDistributedLock.TryAcquireAsync.h3ZvrsNxi9ZoUPGAFzUdCQ.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.Dispose().md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.Dispose().md new file mode 100644 index 00000000..0984c92d --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') + +## AzureBlobLeaseDistributedLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..7043c61e --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') + +## AzureBlobLeaseDistributedLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.HandleLostToken.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.HandleLostToken.md new file mode 100644 index 00000000..6c793b9b --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') + +## AzureBlobLeaseDistributedLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.LeaseId.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.LeaseId.md new file mode 100644 index 00000000..db62f799 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.LeaseId.md @@ -0,0 +1,13 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') + +## AzureBlobLeaseDistributedLockHandle.LeaseId Property + +The underlying Azure lease ID + +```csharp +public string LeaseId { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.md new file mode 100644 index 00000000..0b78077f --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedLockHandle.md @@ -0,0 +1,27 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure') + +## AzureBlobLeaseDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class AzureBlobLeaseDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 AzureBlobLeaseDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](AzureBlobLeaseDistributedLockHandle.HandleLostToken.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | +| [LeaseId](AzureBlobLeaseDistributedLockHandle.LeaseId.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle.LeaseId') | The underlying Azure lease ID | + +| Methods | | +| :--- | :--- | +| [Dispose()](AzureBlobLeaseDistributedLockHandle.Dispose().md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](AzureBlobLeaseDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider..ctor.zZb9hLixHKXBbm4hZNaVyQ.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider..ctor.zZb9hLixHKXBbm4hZNaVyQ.md new file mode 100644 index 00000000..62759c54 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider..ctor.zZb9hLixHKXBbm4hZNaVyQ.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedSynchronizationProvider](AzureBlobLeaseDistributedSynchronizationProvider.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider') + +## AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient, Action) Constructor + +Constructs a provider that scopes blobs within the provided [blobContainerClient](AzureBlobLeaseDistributedSynchronizationProvider..ctor.zZb9hLixHKXBbm4hZNaVyQ.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).blobContainerClient 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient, System.Action).blobContainerClient') and uses the provided [options](AzureBlobLeaseDistributedSynchronizationProvider..ctor.zZb9hLixHKXBbm4hZNaVyQ.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).options 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient, System.Action).options'). + +```csharp +public AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient blobContainerClient, System.Action? options=null); +``` +#### Parameters + + + +`blobContainerClient` [Azure.Storage.Blobs.BlobContainerClient](https://docs.microsoft.com/en-us/dotnet/api/Azure.Storage.Blobs.BlobContainerClient 'Azure.Storage.Blobs.BlobContainerClient') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider.CreateLock.I34EpC7k9lisV6FiK0xunw.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider.CreateLock.I34EpC7k9lisV6FiK0xunw.md new file mode 100644 index 00000000..a3a27623 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider.CreateLock.I34EpC7k9lisV6FiK0xunw.md @@ -0,0 +1,20 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseDistributedSynchronizationProvider](AzureBlobLeaseDistributedSynchronizationProvider.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider') + +## AzureBlobLeaseDistributedSynchronizationProvider.CreateLock(string) Method + +Constructs an [AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') with the given [name](AzureBlobLeaseDistributedSynchronizationProvider.CreateLock.I34EpC7k9lisV6FiK0xunw.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.CreateLock(string).name 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.CreateLock(string).name'). + +```csharp +public Medallion.Threading.Azure.AzureBlobLeaseDistributedLock CreateLock(string name); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +Implements [CreateLock(string)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(System.String)') + +#### Returns +[AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider.md new file mode 100644 index 00000000..ecb59d71 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseDistributedSynchronizationProvider.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure') + +## AzureBlobLeaseDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') + +```csharp +public sealed class AzureBlobLeaseDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 AzureBlobLeaseDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + +| Constructors | | +| :--- | :--- | +| [AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient, Action<AzureBlobLeaseOptionsBuilder>)](AzureBlobLeaseDistributedSynchronizationProvider..ctor.zZb9hLixHKXBbm4hZNaVyQ.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient, System.Action)') | Constructs a provider that scopes blobs within the provided [blobContainerClient](AzureBlobLeaseDistributedSynchronizationProvider..ctor.zZb9hLixHKXBbm4hZNaVyQ.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).blobContainerClient 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient, System.Action).blobContainerClient') and uses the provided [options](AzureBlobLeaseDistributedSynchronizationProvider..ctor.zZb9hLixHKXBbm4hZNaVyQ.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient,System.Action_Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder_).options 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.AzureBlobLeaseDistributedSynchronizationProvider(BlobContainerClient, System.Action).options'). | + +| Methods | | +| :--- | :--- | +| [CreateLock(string)](AzureBlobLeaseDistributedSynchronizationProvider.CreateLock.I34EpC7k9lisV6FiK0xunw.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.CreateLock(string)') | Constructs an [AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') with the given [name](AzureBlobLeaseDistributedSynchronizationProvider.CreateLock.I34EpC7k9lisV6FiK0xunw.md#Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.CreateLock(string).name 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider.CreateLock(string).name'). | diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.BusyWaitSleepTime.mMUlB7vk6GdAQl9sAcmgNg.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.BusyWaitSleepTime.mMUlB7vk6GdAQl9sAcmgNg.md new file mode 100644 index 00000000..b04ceb28 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.BusyWaitSleepTime.mMUlB7vk6GdAQl9sAcmgNg.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder') + +## AzureBlobLeaseOptionsBuilder.BusyWaitSleepTime(TimeSpan, TimeSpan) Method + +Waiting to acquire a lease requires a busy wait that alternates acquire attempts and sleeps. +This determines how much time is spent sleeping between attempts. Lower values will raise the +volume of acquire requests under contention but will also raise the responsiveness (how long +it takes a waiter to notice that a contended the lease has become available). + +Specifying a range of values allows the implementation to select an actual value in the range +at random for each sleep. This helps avoid the case where two clients become "synchronized" +in such a way that results in one client monopolizing the lease. + +The default is [250ms, 1s] + +```csharp +public Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder BusyWaitSleepTime(System.TimeSpan min, System.TimeSpan max); +``` +#### Parameters + + + +`min` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`max` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.Duration.QEP6QPTxOgzkkg0h39jM/g.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.Duration.QEP6QPTxOgzkkg0h39jM/g.md new file mode 100644 index 00000000..f2ebc9f5 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.Duration.QEP6QPTxOgzkkg0h39jM/g.md @@ -0,0 +1,27 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder') + +## AzureBlobLeaseOptionsBuilder.Duration(TimeSpan) Method + +Specifies how long the lease will last, absent auto-renewal. + +If auto-renewal is enabled (the default), then a shorter duration means more frequent auto-renewal requests, +while an infinite duration means no auto-renewal requests. Furthermore, if the lease-holding process were to +exit without explicitly releasing, then duration determines how long other processes would need to wait in +order to acquire the lease. + +If auto-renewal is disabled, then duration determines how long the lease will be held. + +Defaults to 30s. + +```csharp +public Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder Duration(System.TimeSpan duration); +``` +#### Parameters + + + +`duration` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.RenewalCadence/x+hnazpWWqAWeDDlrJmTg.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.RenewalCadence/x+hnazpWWqAWeDDlrJmTg.md new file mode 100644 index 00000000..41f034da --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.RenewalCadence/x+hnazpWWqAWeDDlrJmTg.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure').[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder') + +## AzureBlobLeaseOptionsBuilder.RenewalCadence(TimeSpan) Method + +Determines how frequently the lease will be renewed when held. More frequent renewal means more unnecessary requests +but also a lower chance of losing the lease due to the process hanging or otherwise failing to get its renewal request in +before the lease duration expires. + +To disable auto-renewal, specify [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + +Defaults to 1/3 of the specified lease duration (may be infinite). + +```csharp +public Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder RenewalCadence(System.TimeSpan renewalCadence); +``` +#### Parameters + + + +`renewalCadence` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.md b/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.md new file mode 100644 index 00000000..53623610 --- /dev/null +++ b/docs/api/DistributedLock.Azure/AzureBlobLeaseOptionsBuilder.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Azure](README.md 'README') +### [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure') + +## AzureBlobLeaseOptionsBuilder Class + +Specifies options for an Azure blob lease + +```csharp +public sealed class AzureBlobLeaseOptionsBuilder +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 AzureBlobLeaseOptionsBuilder + +| Methods | | +| :--- | :--- | +| [BusyWaitSleepTime(TimeSpan, TimeSpan)](AzureBlobLeaseOptionsBuilder.BusyWaitSleepTime.mMUlB7vk6GdAQl9sAcmgNg.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder.BusyWaitSleepTime(System.TimeSpan, System.TimeSpan)') | Waiting to acquire a lease requires a busy wait that alternates acquire attempts and sleeps. This determines how much time is spent sleeping between attempts. Lower values will raise the volume of acquire requests under contention but will also raise the responsiveness (how long it takes a waiter to notice that a contended the lease has become available). Specifying a range of values allows the implementation to select an actual value in the range at random for each sleep. This helps avoid the case where two clients become "synchronized" in such a way that results in one client monopolizing the lease. The default is [250ms, 1s] | +| [Duration(TimeSpan)](AzureBlobLeaseOptionsBuilder.Duration.QEP6QPTxOgzkkg0h39jM/g.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder.Duration(System.TimeSpan)') | Specifies how long the lease will last, absent auto-renewal. If auto-renewal is enabled (the default), then a shorter duration means more frequent auto-renewal requests, while an infinite duration means no auto-renewal requests. Furthermore, if the lease-holding process were to exit without explicitly releasing, then duration determines how long other processes would need to wait in order to acquire the lease. If auto-renewal is disabled, then duration determines how long the lease will be held. Defaults to 30s. | +| [RenewalCadence(TimeSpan)](AzureBlobLeaseOptionsBuilder.RenewalCadence./x+hnazpWWqAWeDDlrJmTg.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder.RenewalCadence(System.TimeSpan)') | Determines how frequently the lease will be renewed when held. More frequent renewal means more unnecessary requests but also a lower chance of losing the lease due to the process hanging or otherwise failing to get its renewal request in before the lease duration expires. To disable auto-renewal, specify [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') Defaults to 1/3 of the specified lease duration (may be infinite). | diff --git a/docs/api/DistributedLock.Azure/Medallion.Threading.Azure.md b/docs/api/DistributedLock.Azure/Medallion.Threading.Azure.md new file mode 100644 index 00000000..01af2e9c --- /dev/null +++ b/docs/api/DistributedLock.Azure/Medallion.Threading.Azure.md @@ -0,0 +1,10 @@ +#### [DistributedLock.Azure](README.md 'README') + +## Medallion.Threading.Azure Namespace + +| Classes | | +| :--- | :--- | +| [AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') | Implements a [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') based on Azure blob leases | +| [AzureBlobLeaseDistributedLockHandle](AzureBlobLeaseDistributedLockHandle.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [AzureBlobLeaseDistributedSynchronizationProvider](AzureBlobLeaseDistributedSynchronizationProvider.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [AzureBlobLeaseDistributedLock](AzureBlobLeaseDistributedLock.md 'Medallion.Threading.Azure.AzureBlobLeaseDistributedLock') | +| [AzureBlobLeaseOptionsBuilder](AzureBlobLeaseOptionsBuilder.md 'Medallion.Threading.Azure.AzureBlobLeaseOptionsBuilder') | Specifies options for an Azure blob lease | diff --git a/docs/api/DistributedLock.Azure/README.md b/docs/api/DistributedLock.Azure/README.md new file mode 100644 index 00000000..88cb1bf1 --- /dev/null +++ b/docs/api/DistributedLock.Azure/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.Azure](README.md 'README') + +## DistributedLock.Azure Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.Azure](Medallion.Threading.Azure.md 'Medallion.Threading.Azure') | | diff --git a/docs/api/DistributedLock.Core/DeadlockException..ctor.7kv3RcT81RlRFP35V3Vh0w.md b/docs/api/DistributedLock.Core/DeadlockException..ctor.7kv3RcT81RlRFP35V3Vh0w.md new file mode 100644 index 00000000..ffc3d094 --- /dev/null +++ b/docs/api/DistributedLock.Core/DeadlockException..ctor.7kv3RcT81RlRFP35V3Vh0w.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') + +## DeadlockException(string, Exception) Constructor + +Constructs an instance of [DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') with the given [message](DeadlockException..ctor.7kv3RcT81RlRFP35V3Vh0w.md#Medallion.Threading.DeadlockException.DeadlockException(string,System.Exception).message 'Medallion.Threading.DeadlockException.DeadlockException(string, System.Exception).message') and [innerException](DeadlockException..ctor.7kv3RcT81RlRFP35V3Vh0w.md#Medallion.Threading.DeadlockException.DeadlockException(string,System.Exception).innerException 'Medallion.Threading.DeadlockException.DeadlockException(string, System.Exception).innerException') + +```csharp +public DeadlockException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DeadlockException..ctor.rZAayxV0jwI4ZmlNNiyAyQ.md b/docs/api/DistributedLock.Core/DeadlockException..ctor.rZAayxV0jwI4ZmlNNiyAyQ.md new file mode 100644 index 00000000..df577758 --- /dev/null +++ b/docs/api/DistributedLock.Core/DeadlockException..ctor.rZAayxV0jwI4ZmlNNiyAyQ.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') + +## DeadlockException(string) Constructor + +Constructs an instance of [DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') with the given [message](DeadlockException..ctor.rZAayxV0jwI4ZmlNNiyAyQ.md#Medallion.Threading.DeadlockException.DeadlockException(string).message 'Medallion.Threading.DeadlockException.DeadlockException(string).message') + +```csharp +public DeadlockException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DeadlockException.DeadlockException().md b/docs/api/DistributedLock.Core/DeadlockException.DeadlockException().md new file mode 100644 index 00000000..2c61a498 --- /dev/null +++ b/docs/api/DistributedLock.Core/DeadlockException.DeadlockException().md @@ -0,0 +1,10 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') + +## DeadlockException() Constructor + +Constructs a new instance of [DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') with a default message + +```csharp +public DeadlockException(); +``` \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DeadlockException.md b/docs/api/DistributedLock.Core/DeadlockException.md new file mode 100644 index 00000000..8b847a8b --- /dev/null +++ b/docs/api/DistributedLock.Core/DeadlockException.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## DeadlockException Class + +An exception that SOME distributed locks will throw under SOME deadlock conditions. Note that even locks +that throw this exception under some circumstances cannot detect ALL deadlock conditions + +```csharp +public sealed class DeadlockException : System.InvalidOperationException +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') 🡒 [System.SystemException](https://docs.microsoft.com/en-us/dotnet/api/System.SystemException 'System.SystemException') 🡒 [System.InvalidOperationException](https://docs.microsoft.com/en-us/dotnet/api/System.InvalidOperationException 'System.InvalidOperationException') 🡒 DeadlockException + +| Constructors | | +| :--- | :--- | +| [DeadlockException()](DeadlockException.DeadlockException().md 'Medallion.Threading.DeadlockException.DeadlockException()') | Constructs a new instance of [DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') with a default message | +| [DeadlockException(string, Exception)](DeadlockException..ctor.7kv3RcT81RlRFP35V3Vh0w.md 'Medallion.Threading.DeadlockException.DeadlockException(string, System.Exception)') | Constructs an instance of [DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') with the given [message](DeadlockException..ctor.7kv3RcT81RlRFP35V3Vh0w.md#Medallion.Threading.DeadlockException.DeadlockException(string,System.Exception).message 'Medallion.Threading.DeadlockException.DeadlockException(string, System.Exception).message') and [innerException](DeadlockException..ctor.7kv3RcT81RlRFP35V3Vh0w.md#Medallion.Threading.DeadlockException.DeadlockException(string,System.Exception).innerException 'Medallion.Threading.DeadlockException.DeadlockException(string, System.Exception).innerException') | +| [DeadlockException(string)](DeadlockException..ctor.rZAayxV0jwI4ZmlNNiyAyQ.md 'Medallion.Threading.DeadlockException.DeadlockException(string)') | Constructs an instance of [DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') with the given [message](DeadlockException..ctor.rZAayxV0jwI4ZmlNNiyAyQ.md#Medallion.Threading.DeadlockException.DeadlockException(string).message 'Medallion.Threading.DeadlockException.DeadlockException(string).message') | diff --git a/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.AcquireLock.DMP8nUt70Bor8mi0Krb42A.md b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.AcquireLock.DMP8nUt70Bor8mi0Krb42A.md new file mode 100644 index 00000000..08b7a3e6 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.AcquireLock.DMP8nUt70Bor8mi0Krb42A.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedLockProviderExtensions](DistributedLockProviderExtensions.md 'Medallion.Threading.DistributedLockProviderExtensions') + +## DistributedLockProviderExtensions.AcquireLock(this IDistributedLockProvider, string, Nullable, CancellationToken) Method + +Equivalent to calling [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') and then +[Acquire(Nullable<TimeSpan>, CancellationToken)](IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedSynchronizationHandle AcquireLock(this Medallion.Threading.IDistributedLockProvider provider, string name, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedLockProvider](IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.AcquireLockAsync.+REikXPbHJ/q+uAX8BwEjg.md b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.AcquireLockAsync.+REikXPbHJ/q+uAX8BwEjg.md new file mode 100644 index 00000000..bc8c4af5 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.AcquireLockAsync.+REikXPbHJ/q+uAX8BwEjg.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedLockProviderExtensions](DistributedLockProviderExtensions.md 'Medallion.Threading.DistributedLockProviderExtensions') + +## DistributedLockProviderExtensions.AcquireLockAsync(this IDistributedLockProvider, string, Nullable, CancellationToken) Method + +Equivalent to calling [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') and then +[AcquireAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask AcquireLockAsync(this Medallion.Threading.IDistributedLockProvider provider, string name, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedLockProvider](IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.TryAcquireLock.1sWD0pz+gM4NV17JJV3RTw.md b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.TryAcquireLock.1sWD0pz+gM4NV17JJV3RTw.md new file mode 100644 index 00000000..9821f0dd --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.TryAcquireLock.1sWD0pz+gM4NV17JJV3RTw.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedLockProviderExtensions](DistributedLockProviderExtensions.md 'Medallion.Threading.DistributedLockProviderExtensions') + +## DistributedLockProviderExtensions.TryAcquireLock(this IDistributedLockProvider, string, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') and then +[TryAcquire(TimeSpan, CancellationToken)](IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedSynchronizationHandle? TryAcquireLock(this Medallion.Threading.IDistributedLockProvider provider, string name, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedLockProvider](IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.TryAcquireLockAsync.eBA2EKzaS4eJOnnXosupQg.md b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.TryAcquireLockAsync.eBA2EKzaS4eJOnnXosupQg.md new file mode 100644 index 00000000..4c0f06bf --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.TryAcquireLockAsync.eBA2EKzaS4eJOnnXosupQg.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedLockProviderExtensions](DistributedLockProviderExtensions.md 'Medallion.Threading.DistributedLockProviderExtensions') + +## DistributedLockProviderExtensions.TryAcquireLockAsync(this IDistributedLockProvider, string, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') and then +[TryAcquireAsync(TimeSpan, CancellationToken)](IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask TryAcquireLockAsync(this Medallion.Threading.IDistributedLockProvider provider, string name, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedLockProvider](IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.md b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.md new file mode 100644 index 00000000..068d9e7f --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedLockProviderExtensions.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## DistributedLockProviderExtensions Class + +Productivity helper methods for [IDistributedLockProvider](IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + +```csharp +public static class DistributedLockProviderExtensions +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DistributedLockProviderExtensions + +| Methods | | +| :--- | :--- | +| [AcquireLock(this IDistributedLockProvider, string, Nullable<TimeSpan>, CancellationToken)](DistributedLockProviderExtensions.AcquireLock.DMP8nUt70Bor8mi0Krb42A.md 'Medallion.Threading.DistributedLockProviderExtensions.AcquireLock(this Medallion.Threading.IDistributedLockProvider, string, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') and then [Acquire(Nullable<TimeSpan>, CancellationToken)](IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)'). | +| [AcquireLockAsync(this IDistributedLockProvider, string, Nullable<TimeSpan>, CancellationToken)](DistributedLockProviderExtensions.AcquireLockAsync.+REikXPbHJ/q+uAX8BwEjg.md 'Medallion.Threading.DistributedLockProviderExtensions.AcquireLockAsync(this Medallion.Threading.IDistributedLockProvider, string, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') and then [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)'). | +| [TryAcquireLock(this IDistributedLockProvider, string, TimeSpan, CancellationToken)](DistributedLockProviderExtensions.TryAcquireLock.1sWD0pz+gM4NV17JJV3RTw.md 'Medallion.Threading.DistributedLockProviderExtensions.TryAcquireLock(this Medallion.Threading.IDistributedLockProvider, string, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') and then [TryAcquire(TimeSpan, CancellationToken)](IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)'). | +| [TryAcquireLockAsync(this IDistributedLockProvider, string, TimeSpan, CancellationToken)](DistributedLockProviderExtensions.TryAcquireLockAsync.eBA2EKzaS4eJOnnXosupQg.md 'Medallion.Threading.DistributedLockProviderExtensions.TryAcquireLockAsync(this Medallion.Threading.IDistributedLockProvider, string, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') and then [TryAcquireAsync(TimeSpan, CancellationToken)](IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)'). | diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireReadLock.ZhZPMV6nWYpiDzXAN3gDOQ.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireReadLock.ZhZPMV6nWYpiDzXAN3gDOQ.md new file mode 100644 index 00000000..78230970 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireReadLock.ZhZPMV6nWYpiDzXAN3gDOQ.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') + +## DistributedReaderWriterLockProviderExtensions.AcquireReadLock(this IDistributedReaderWriterLockProvider, string, Nullable, CancellationToken) Method + +Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then +[AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedSynchronizationHandle AcquireReadLock(this Medallion.Threading.IDistributedReaderWriterLockProvider provider, string name, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireReadLockAsync.btqzvB7WyYZWa9xgYACZmA.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireReadLockAsync.btqzvB7WyYZWa9xgYACZmA.md new file mode 100644 index 00000000..16eb057e --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireReadLockAsync.btqzvB7WyYZWa9xgYACZmA.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') + +## DistributedReaderWriterLockProviderExtensions.AcquireReadLockAsync(this IDistributedReaderWriterLockProvider, string, Nullable, CancellationToken) Method + +Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then +[AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask AcquireReadLockAsync(this Medallion.Threading.IDistributedReaderWriterLockProvider provider, string name, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireWriteLock.KIDCaBOI+d5buraGWrnHpg.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireWriteLock.KIDCaBOI+d5buraGWrnHpg.md new file mode 100644 index 00000000..cc5e86e4 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireWriteLock.KIDCaBOI+d5buraGWrnHpg.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') + +## DistributedReaderWriterLockProviderExtensions.AcquireWriteLock(this IDistributedReaderWriterLockProvider, string, Nullable, CancellationToken) Method + +Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then +[AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedSynchronizationHandle AcquireWriteLock(this Medallion.Threading.IDistributedReaderWriterLockProvider provider, string name, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireWriteLockAsync.HT7LKAp7tqVtM/Vet3jdKQ.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireWriteLockAsync.HT7LKAp7tqVtM/Vet3jdKQ.md new file mode 100644 index 00000000..40b19d56 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.AcquireWriteLockAsync.HT7LKAp7tqVtM/Vet3jdKQ.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') + +## DistributedReaderWriterLockProviderExtensions.AcquireWriteLockAsync(this IDistributedReaderWriterLockProvider, string, Nullable, CancellationToken) Method + +Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then +[AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask AcquireWriteLockAsync(this Medallion.Threading.IDistributedReaderWriterLockProvider provider, string name, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireReadLock.vOCz3Wz2jkDdUYGywzVM8Q.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireReadLock.vOCz3Wz2jkDdUYGywzVM8Q.md new file mode 100644 index 00000000..287c4518 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireReadLock.vOCz3Wz2jkDdUYGywzVM8Q.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') + +## DistributedReaderWriterLockProviderExtensions.TryAcquireReadLock(this IDistributedReaderWriterLockProvider, string, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then +[TryAcquireReadLock(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedSynchronizationHandle? TryAcquireReadLock(this Medallion.Threading.IDistributedReaderWriterLockProvider provider, string name, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireReadLockAsync.A1jgGtvBfzba5znceHCWSQ.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireReadLockAsync.A1jgGtvBfzba5znceHCWSQ.md new file mode 100644 index 00000000..aa6b71a7 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireReadLockAsync.A1jgGtvBfzba5znceHCWSQ.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') + +## DistributedReaderWriterLockProviderExtensions.TryAcquireReadLockAsync(this IDistributedReaderWriterLockProvider, string, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then +[TryAcquireReadLockAsync(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask TryAcquireReadLockAsync(this Medallion.Threading.IDistributedReaderWriterLockProvider provider, string name, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLock.JkEs48Kec6mXgXRDEw9ElQ.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLock.JkEs48Kec6mXgXRDEw9ElQ.md new file mode 100644 index 00000000..11e8d150 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLock.JkEs48Kec6mXgXRDEw9ElQ.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') + +## DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLock(this IDistributedReaderWriterLockProvider, string, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then +[TryAcquireWriteLock(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedSynchronizationHandle? TryAcquireWriteLock(this Medallion.Threading.IDistributedReaderWriterLockProvider provider, string name, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLockAsync.tsNArNTtLZ78uW3mRNiz0w.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLockAsync.tsNArNTtLZ78uW3mRNiz0w.md new file mode 100644 index 00000000..5e98cd2e --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLockAsync.tsNArNTtLZ78uW3mRNiz0w.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') + +## DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLockAsync(this IDistributedReaderWriterLockProvider, string, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then +[TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask TryAcquireWriteLockAsync(this Medallion.Threading.IDistributedReaderWriterLockProvider provider, string name, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.md b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.md new file mode 100644 index 00000000..950422a2 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedReaderWriterLockProviderExtensions.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## DistributedReaderWriterLockProviderExtensions Class + +Productivity helper methods for [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + +```csharp +public static class DistributedReaderWriterLockProviderExtensions +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DistributedReaderWriterLockProviderExtensions + +| Methods | | +| :--- | :--- | +| [AcquireReadLock(this IDistributedReaderWriterLockProvider, string, Nullable<TimeSpan>, CancellationToken)](DistributedReaderWriterLockProviderExtensions.AcquireReadLock.ZhZPMV6nWYpiDzXAN3gDOQ.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions.AcquireReadLock(this Medallion.Threading.IDistributedReaderWriterLockProvider, string, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)'). | +| [AcquireReadLockAsync(this IDistributedReaderWriterLockProvider, string, Nullable<TimeSpan>, CancellationToken)](DistributedReaderWriterLockProviderExtensions.AcquireReadLockAsync.btqzvB7WyYZWa9xgYACZmA.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions.AcquireReadLockAsync(this Medallion.Threading.IDistributedReaderWriterLockProvider, string, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable, System.Threading.CancellationToken)'). | +| [AcquireWriteLock(this IDistributedReaderWriterLockProvider, string, Nullable<TimeSpan>, CancellationToken)](DistributedReaderWriterLockProviderExtensions.AcquireWriteLock.KIDCaBOI+d5buraGWrnHpg.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions.AcquireWriteLock(this Medallion.Threading.IDistributedReaderWriterLockProvider, string, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)'). | +| [AcquireWriteLockAsync(this IDistributedReaderWriterLockProvider, string, Nullable<TimeSpan>, CancellationToken)](DistributedReaderWriterLockProviderExtensions.AcquireWriteLockAsync.HT7LKAp7tqVtM/Vet3jdKQ.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions.AcquireWriteLockAsync(this Medallion.Threading.IDistributedReaderWriterLockProvider, string, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable, System.Threading.CancellationToken)'). | +| [TryAcquireReadLock(this IDistributedReaderWriterLockProvider, string, TimeSpan, CancellationToken)](DistributedReaderWriterLockProviderExtensions.TryAcquireReadLock.vOCz3Wz2jkDdUYGywzVM8Q.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions.TryAcquireReadLock(this Medallion.Threading.IDistributedReaderWriterLockProvider, string, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then [TryAcquireReadLock(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan, System.Threading.CancellationToken)'). | +| [TryAcquireReadLockAsync(this IDistributedReaderWriterLockProvider, string, TimeSpan, CancellationToken)](DistributedReaderWriterLockProviderExtensions.TryAcquireReadLockAsync.A1jgGtvBfzba5znceHCWSQ.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions.TryAcquireReadLockAsync(this Medallion.Threading.IDistributedReaderWriterLockProvider, string, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)'). | +| [TryAcquireWriteLock(this IDistributedReaderWriterLockProvider, string, TimeSpan, CancellationToken)](DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLock.JkEs48Kec6mXgXRDEw9ElQ.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLock(this Medallion.Threading.IDistributedReaderWriterLockProvider, string, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then [TryAcquireWriteLock(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan, System.Threading.CancellationToken)'). | +| [TryAcquireWriteLockAsync(this IDistributedReaderWriterLockProvider, string, TimeSpan, CancellationToken)](DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLockAsync.tsNArNTtLZ78uW3mRNiz0w.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions.TryAcquireWriteLockAsync(this Medallion.Threading.IDistributedReaderWriterLockProvider, string, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') and then [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)'). | diff --git a/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.AcquireSemaphore.XSSUj7gKekS+ySxX0Ib0hA.md b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.AcquireSemaphore.XSSUj7gKekS+ySxX0Ib0hA.md new file mode 100644 index 00000000..81ab188d --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.AcquireSemaphore.XSSUj7gKekS+ySxX0Ib0hA.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedSemaphoreProviderExtensions](DistributedSemaphoreProviderExtensions.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions') + +## DistributedSemaphoreProviderExtensions.AcquireSemaphore(this IDistributedSemaphoreProvider, string, int, Nullable, CancellationToken) Method + +Equivalent to calling [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') and then +[Acquire(Nullable<TimeSpan>, CancellationToken)](IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md 'Medallion.Threading.IDistributedSemaphore.Acquire(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedSynchronizationHandle AcquireSemaphore(this Medallion.Threading.IDistributedSemaphoreProvider provider, string name, int maxCount, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedSemaphoreProvider](IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.AcquireSemaphoreAsync.lqwIyu+bS538c/gXNLgnKQ.md b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.AcquireSemaphoreAsync.lqwIyu+bS538c/gXNLgnKQ.md new file mode 100644 index 00000000..40d60b40 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.AcquireSemaphoreAsync.lqwIyu+bS538c/gXNLgnKQ.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedSemaphoreProviderExtensions](DistributedSemaphoreProviderExtensions.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions') + +## DistributedSemaphoreProviderExtensions.AcquireSemaphoreAsync(this IDistributedSemaphoreProvider, string, int, Nullable, CancellationToken) Method + +Equivalent to calling [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') and then +[AcquireAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md 'Medallion.Threading.IDistributedSemaphore.AcquireAsync(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask AcquireSemaphoreAsync(this Medallion.Threading.IDistributedSemaphoreProvider provider, string name, int maxCount, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedSemaphoreProvider](IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.TryAcquireSemaphore.Onb/urIfHteJZkfKKtFB7A.md b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.TryAcquireSemaphore.Onb/urIfHteJZkfKKtFB7A.md new file mode 100644 index 00000000..788b148c --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.TryAcquireSemaphore.Onb/urIfHteJZkfKKtFB7A.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedSemaphoreProviderExtensions](DistributedSemaphoreProviderExtensions.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions') + +## DistributedSemaphoreProviderExtensions.TryAcquireSemaphore(this IDistributedSemaphoreProvider, string, int, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') and then +[TryAcquire(TimeSpan, CancellationToken)](IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md 'Medallion.Threading.IDistributedSemaphore.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedSynchronizationHandle? TryAcquireSemaphore(this Medallion.Threading.IDistributedSemaphoreProvider provider, string name, int maxCount, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedSemaphoreProvider](IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.TryAcquireSemaphoreAsync.4x4cCEwsrDjb1URUsaVDyg.md b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.TryAcquireSemaphoreAsync.4x4cCEwsrDjb1URUsaVDyg.md new file mode 100644 index 00000000..f3539dc9 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.TryAcquireSemaphoreAsync.4x4cCEwsrDjb1URUsaVDyg.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedSemaphoreProviderExtensions](DistributedSemaphoreProviderExtensions.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions') + +## DistributedSemaphoreProviderExtensions.TryAcquireSemaphoreAsync(this IDistributedSemaphoreProvider, string, int, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') and then +[TryAcquireAsync(TimeSpan, CancellationToken)](IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md 'Medallion.Threading.IDistributedSemaphore.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask TryAcquireSemaphoreAsync(this Medallion.Threading.IDistributedSemaphoreProvider provider, string name, int maxCount, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedSemaphoreProvider](IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.md b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.md new file mode 100644 index 00000000..1bb2535f --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedSemaphoreProviderExtensions.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## DistributedSemaphoreProviderExtensions Class + +Productivity helper methods for [IDistributedSemaphoreProvider](IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + +```csharp +public static class DistributedSemaphoreProviderExtensions +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DistributedSemaphoreProviderExtensions + +| Methods | | +| :--- | :--- | +| [AcquireSemaphore(this IDistributedSemaphoreProvider, string, int, Nullable<TimeSpan>, CancellationToken)](DistributedSemaphoreProviderExtensions.AcquireSemaphore.XSSUj7gKekS+ySxX0Ib0hA.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions.AcquireSemaphore(this Medallion.Threading.IDistributedSemaphoreProvider, string, int, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') and then [Acquire(Nullable<TimeSpan>, CancellationToken)](IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md 'Medallion.Threading.IDistributedSemaphore.Acquire(System.Nullable, System.Threading.CancellationToken)'). | +| [AcquireSemaphoreAsync(this IDistributedSemaphoreProvider, string, int, Nullable<TimeSpan>, CancellationToken)](DistributedSemaphoreProviderExtensions.AcquireSemaphoreAsync.lqwIyu+bS538c/gXNLgnKQ.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions.AcquireSemaphoreAsync(this Medallion.Threading.IDistributedSemaphoreProvider, string, int, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') and then [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md 'Medallion.Threading.IDistributedSemaphore.AcquireAsync(System.Nullable, System.Threading.CancellationToken)'). | +| [TryAcquireSemaphore(this IDistributedSemaphoreProvider, string, int, TimeSpan, CancellationToken)](DistributedSemaphoreProviderExtensions.TryAcquireSemaphore.Onb/urIfHteJZkfKKtFB7A.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions.TryAcquireSemaphore(this Medallion.Threading.IDistributedSemaphoreProvider, string, int, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') and then [TryAcquire(TimeSpan, CancellationToken)](IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md 'Medallion.Threading.IDistributedSemaphore.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)'). | +| [TryAcquireSemaphoreAsync(this IDistributedSemaphoreProvider, string, int, TimeSpan, CancellationToken)](DistributedSemaphoreProviderExtensions.TryAcquireSemaphoreAsync.4x4cCEwsrDjb1URUsaVDyg.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions.TryAcquireSemaphoreAsync(this Medallion.Threading.IDistributedSemaphoreProvider, string, int, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') and then [TryAcquireAsync(TimeSpan, CancellationToken)](IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md 'Medallion.Threading.IDistributedSemaphore.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)'). | diff --git a/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLock.LhlQ1GjOVkQgN5H/PekFHw.md b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLock.LhlQ1GjOVkQgN5H/PekFHw.md new file mode 100644 index 00000000..cfffb1b0 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLock.LhlQ1GjOVkQgN5H/PekFHw.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedUpgradeableReaderWriterLockProviderExtensions](DistributedUpgradeableReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions') + +## DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLock(this IDistributedUpgradeableReaderWriterLockProvider, string, Nullable, CancellationToken) Method + +Equivalent to calling [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') and then +[AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock.MgsbqNeNv0qen0RVQV8MHA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedLockUpgradeableHandle AcquireUpgradeableReadLock(this Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider provider, string name, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLockAsync.ESXR5pVbQ3ZCoCNayGDOPQ.md b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLockAsync.ESXR5pVbQ3ZCoCNayGDOPQ.md new file mode 100644 index 00000000..861eb551 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLockAsync.ESXR5pVbQ3ZCoCNayGDOPQ.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedUpgradeableReaderWriterLockProviderExtensions](DistributedUpgradeableReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions') + +## DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLockAsync(this IDistributedUpgradeableReaderWriterLockProvider, string, Nullable, CancellationToken) Method + +Equivalent to calling [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') and then +[AcquireUpgradeableReadLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync.XDD/LbfIJrScMNU14D5OvA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync(System.Nullable, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask AcquireUpgradeableReadLockAsync(this Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider provider, string name, System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLock.5Zr97IQvZb/lygC7zTxR2A.md b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLock.5Zr97IQvZb/lygC7zTxR2A.md new file mode 100644 index 00000000..67197ed3 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLock.5Zr97IQvZb/lygC7zTxR2A.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedUpgradeableReaderWriterLockProviderExtensions](DistributedUpgradeableReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions') + +## DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLock(this IDistributedUpgradeableReaderWriterLockProvider, string, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') and then +[TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken)](IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock.NcomTiK4v4VsrD5p8zrY6A.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static Medallion.Threading.IDistributedLockUpgradeableHandle? TryAcquireUpgradeableReadLock(this Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider provider, string name, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLockAsync.xlsczpQ3Zsbfz74nI0lnPw.md b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLockAsync.xlsczpQ3Zsbfz74nI0lnPw.md new file mode 100644 index 00000000..f9852907 --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLockAsync.xlsczpQ3Zsbfz74nI0lnPw.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[DistributedUpgradeableReaderWriterLockProviderExtensions](DistributedUpgradeableReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions') + +## DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLockAsync(this IDistributedUpgradeableReaderWriterLockProvider, string, TimeSpan, CancellationToken) Method + +Equivalent to calling [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') and then +[TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken)](IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync.NeQQ4jMkCO0IteXQSJv/1w.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)'). + +```csharp +public static System.Threading.Tasks.ValueTask TryAcquireUpgradeableReadLockAsync(this Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider provider, string name, System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`provider` [IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.md b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.md new file mode 100644 index 00000000..fceed19a --- /dev/null +++ b/docs/api/DistributedLock.Core/DistributedUpgradeableReaderWriterLockProviderExtensions.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## DistributedUpgradeableReaderWriterLockProviderExtensions Class + +Productivity helper methods for [IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') + +```csharp +public static class DistributedUpgradeableReaderWriterLockProviderExtensions +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 DistributedUpgradeableReaderWriterLockProviderExtensions + +| Methods | | +| :--- | :--- | +| [AcquireUpgradeableReadLock(this IDistributedUpgradeableReaderWriterLockProvider, string, Nullable<TimeSpan>, CancellationToken)](DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLock.LhlQ1GjOVkQgN5H/PekFHw.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLock(this Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider, string, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') and then [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock.MgsbqNeNv0qen0RVQV8MHA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)'). | +| [AcquireUpgradeableReadLockAsync(this IDistributedUpgradeableReaderWriterLockProvider, string, Nullable<TimeSpan>, CancellationToken)](DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLockAsync.ESXR5pVbQ3ZCoCNayGDOPQ.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions.AcquireUpgradeableReadLockAsync(this Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider, string, System.Nullable, System.Threading.CancellationToken)') | Equivalent to calling [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') and then [AcquireUpgradeableReadLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync.XDD/LbfIJrScMNU14D5OvA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync(System.Nullable, System.Threading.CancellationToken)'). | +| [TryAcquireUpgradeableReadLock(this IDistributedUpgradeableReaderWriterLockProvider, string, TimeSpan, CancellationToken)](DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLock.5Zr97IQvZb/lygC7zTxR2A.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLock(this Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider, string, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') and then [TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken)](IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock.NcomTiK4v4VsrD5p8zrY6A.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock(System.TimeSpan, System.Threading.CancellationToken)'). | +| [TryAcquireUpgradeableReadLockAsync(this IDistributedUpgradeableReaderWriterLockProvider, string, TimeSpan, CancellationToken)](DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLockAsync.xlsczpQ3Zsbfz74nI0lnPw.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions.TryAcquireUpgradeableReadLockAsync(this Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider, string, System.TimeSpan, System.Threading.CancellationToken)') | Equivalent to calling [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') and then [TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken)](IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync.NeQQ4jMkCO0IteXQSJv/1w.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)'). | diff --git a/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md b/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md new file mode 100644 index 00000000..a1470380 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +## IDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +Medallion.Threading.IDistributedSynchronizationHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md b/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md new file mode 100644 index 00000000..f6381ffe --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +## IDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLock.Name.md b/docs/api/DistributedLock.Core/IDistributedLock.Name.md new file mode 100644 index 00000000..129e5da5 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLock.Name.md @@ -0,0 +1,13 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +## IDistributedLock.Name Property + +A name that uniquely identifies the lock + +```csharp +string Name { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md b/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md new file mode 100644 index 00000000..4d93c450 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +## IDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +Medallion.Threading.IDistributedSynchronizationHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md b/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md new file mode 100644 index 00000000..442329e2 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +## IDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLock.md b/docs/api/DistributedLock.Core/IDistributedLock.md new file mode 100644 index 00000000..b9dd3c83 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLock.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedLock Interface + +A mutex synchronization primitive which can be used to coordinate access to a resource or critical region of code +across processes or systems. The scope and capabilities of the lock are dependent on the particular implementation + +```csharp +public interface IDistributedLock +``` + +| Properties | | +| :--- | :--- | +| [Name](IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | A name that uniquely identifies the lock | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.Core/IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md b/docs/api/DistributedLock.Core/IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md new file mode 100644 index 00000000..ce7ad892 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLockProvider](IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + +## IDistributedLockProvider.CreateLock(string) Method + +Constructs an [IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') instance with the given [name](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md#Medallion.Threading.IDistributedLockProvider.CreateLock(string).name 'Medallion.Threading.IDistributedLockProvider.CreateLock(string).name'). + +```csharp +Medallion.Threading.IDistributedLock CreateLock(string name); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +#### Returns +[IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLockProvider.md b/docs/api/DistributedLock.Core/IDistributedLockProvider.md new file mode 100644 index 00000000..8445e712 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLockProvider.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedLockProvider Interface + +Acts as a factory for [IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') instances of a certain type. This interface may be +easier to use than [IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') in dependency injection scenarios. + +```csharp +public interface IDistributedLockProvider +``` + +| Methods | | +| :--- | :--- | +| [CreateLock(string)](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(string)') | Constructs an [IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') instance with the given [name](IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md#Medallion.Threading.IDistributedLockProvider.CreateLock(string).name 'Medallion.Threading.IDistributedLockProvider.CreateLock(string).name'). | diff --git a/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md new file mode 100644 index 00000000..2238363a --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') + +## IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock(TimeSpan, CancellationToken) Method + +Attempts to upgrade a WRITE lock synchronously. Not compatible with another WRITE lock or a UPGRADE lock + +```csharp +bool TryUpgradeToWriteLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md new file mode 100644 index 00000000..74643d87 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') + +## IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken) Method + +Attempts to upgrade a WRITE lock asynchronously. Not compatible with another WRITE lock or a UPGRADE lock + +```csharp +System.Threading.Tasks.ValueTask TryUpgradeToWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md new file mode 100644 index 00000000..50e7291b --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') + +## IDistributedLockUpgradeableHandle.UpgradeToWriteLock(Nullable, CancellationToken) Method + +Upgrades to a WRITE lock synchronously. Not compatible with another WRITE lock or a UPGRADE lock + +```csharp +void UpgradeToWriteLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md new file mode 100644 index 00000000..a9674a1a --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') + +## IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync(Nullable, CancellationToken) Method + +Upgrades to a WRITE lock asynchronously. Not compatible with another WRITE lock or a UPGRADE lock + +```csharp +System.Threading.Tasks.ValueTask UpgradeToWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md new file mode 100644 index 00000000..7080b127 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedLockUpgradeableHandle Interface + +A [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') that can be upgraded to a write lock + +```csharp +public interface IDistributedLockUpgradeableHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Implements [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Methods | | +| :--- | :--- | +| [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to upgrade a WRITE lock synchronously. Not compatible with another WRITE lock or a UPGRADE lock | +| [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to upgrade a WRITE lock asynchronously. Not compatible with another WRITE lock or a UPGRADE lock | +| [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable, System.Threading.CancellationToken)') | Upgrades to a WRITE lock synchronously. Not compatible with another WRITE lock or a UPGRADE lock | +| [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Upgrades to a WRITE lock asynchronously. Not compatible with another WRITE lock or a UPGRADE lock | diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md new file mode 100644 index 00000000..b67a8b91 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.AcquireReadLock(Nullable, CancellationToken) Method + +Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (myLock.AcquireReadLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +Medallion.Threading.IDistributedSynchronizationHandle AcquireReadLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md new file mode 100644 index 00000000..2f2f1c75 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.AcquireReadLockAsync(Nullable, CancellationToken) Method + +Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +System.Threading.Tasks.ValueTask AcquireReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md new file mode 100644 index 00000000..1907646f --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.AcquireWriteLock(Nullable, CancellationToken) Method + +Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (myLock.AcquireWriteLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +Medallion.Threading.IDistributedSynchronizationHandle AcquireWriteLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md new file mode 100644 index 00000000..22c33010 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.AcquireWriteLockAsync(Nullable, CancellationToken) Method + +Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (await myLock.AcquireWriteLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +System.Threading.Tasks.ValueTask AcquireWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md new file mode 100644 index 00000000..7d99edda --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md @@ -0,0 +1,13 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.Name Property + +A name that uniquely identifies the lock + +```csharp +string Name { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md new file mode 100644 index 00000000..796e5819 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.TryAcquireReadLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireReadLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +Medallion.Threading.IDistributedSynchronizationHandle? TryAcquireReadLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md new file mode 100644 index 00000000..7eeaff05 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.TryAcquireReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +System.Threading.Tasks.ValueTask TryAcquireReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md new file mode 100644 index 00000000..983dae31 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.TryAcquireWriteLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireWriteLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +Medallion.Threading.IDistributedSynchronizationHandle? TryAcquireWriteLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md new file mode 100644 index 00000000..72c3eca9 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +## IDistributedReaderWriterLock.TryAcquireWriteLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireWriteLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +System.Threading.Tasks.ValueTask TryAcquireWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md new file mode 100644 index 00000000..ed747865 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md @@ -0,0 +1,28 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedReaderWriterLock Interface + +Provides distributed locking functionality comparable to [System.Threading.ReaderWriterLock](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.ReaderWriterLock 'System.Threading.ReaderWriterLock') + +```csharp +public interface IDistributedReaderWriterLock +``` + +Derived +↳ [IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') + +| Properties | | +| :--- | :--- | +| [Name](IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name') | A name that uniquely identifies the lock | + +| Methods | | +| :--- | :--- | +| [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireReadLock(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireWriteLock(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md new file mode 100644 index 00000000..66bddf4c --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + +## IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string) Method + +Constructs an [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') instance with the given [name](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md#Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string).name 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string).name'). + +```csharp +Medallion.Threading.IDistributedReaderWriterLock CreateReaderWriterLock(string name); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +#### Returns +[IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md b/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md new file mode 100644 index 00000000..53a2da6a --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedReaderWriterLockProvider Interface + +Acts as a factory for [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') instances of a certain type. This interface may be +easier to use than [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') in dependency injection scenarios. + +```csharp +public interface IDistributedReaderWriterLockProvider +``` + +Derived +↳ [IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') + +| Methods | | +| :--- | :--- | +| [CreateReaderWriterLock(string)](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string)') | Constructs an [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') instance with the given [name](IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md#Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string).name 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(string).name'). | diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md b/docs/api/DistributedLock.Core/IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md new file mode 100644 index 00000000..cb376189 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +## IDistributedSemaphore.Acquire(Nullable, CancellationToken) Method + +Acquires a semaphore ticket synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (mySemaphore.Acquire(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +Medallion.Threading.IDistributedSynchronizationHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md b/docs/api/DistributedLock.Core/IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md new file mode 100644 index 00000000..0a84368c --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +## IDistributedSemaphore.AcquireAsync(Nullable, CancellationToken) Method + +Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await mySemaphore.AcquireAsync(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md b/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md new file mode 100644 index 00000000..52a0c243 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md @@ -0,0 +1,14 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +## IDistributedSemaphore.MaxCount Property + +The maximum number of "tickets" available for the semaphore (ie the number of processes which can acquire +the semaphore concurrently). + +```csharp +int MaxCount { get; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md b/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md new file mode 100644 index 00000000..0709872c --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md @@ -0,0 +1,13 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +## IDistributedSemaphore.Name Property + +A name that uniquely identifies the semaphore + +```csharp +string Name { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md b/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md new file mode 100644 index 00000000..6c27ed12 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +## IDistributedSemaphore.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket synchronously. Usage: + +```csharp +using (var handle = mySemaphore.TryAcquire(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +Medallion.Threading.IDistributedSynchronizationHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md b/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md new file mode 100644 index 00000000..89da1802 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +## IDistributedSemaphore.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket asynchronously. Usage: + +```csharp +await using (var handle = await mySemaphore.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphore.md b/docs/api/DistributedLock.Core/IDistributedSemaphore.md new file mode 100644 index 00000000..9d1934a5 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphore.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedSemaphore Interface + +A synchronization primitive which restricts access to a resource or critical section of code to a fixed number of concurrent threads/processes. +Compare to [System.Threading.Semaphore](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Semaphore 'System.Threading.Semaphore'). + +```csharp +public interface IDistributedSemaphore +``` + +| Properties | | +| :--- | :--- | +| [MaxCount](IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') | The maximum number of "tickets" available for the semaphore (ie the number of processes which can acquire the semaphore concurrently). | +| [Name](IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') | A name that uniquely identifies the semaphore | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md 'Medallion.Threading.IDistributedSemaphore.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md 'Medallion.Threading.IDistributedSemaphore.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md 'Medallion.Threading.IDistributedSemaphore.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md 'Medallion.Threading.IDistributedSemaphore.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket asynchronously. Usage: | diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md b/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md new file mode 100644 index 00000000..c113d66c --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedSemaphoreProvider](IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + +## IDistributedSemaphoreProvider.CreateSemaphore(string, int) Method + +Constructs an [IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') instance with the given [name](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md#Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string,int).name 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int).name'). + +```csharp +Medallion.Threading.IDistributedSemaphore CreateSemaphore(string name, int maxCount); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +#### Returns +[IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md b/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md new file mode 100644 index 00000000..c70aeeee --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedSemaphoreProvider Interface + +Acts as a factory for [IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') instances of a certain type. This interface may be +easier to use than [IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') in dependency injection scenarios. + +```csharp +public interface IDistributedSemaphoreProvider +``` + +| Methods | | +| :--- | :--- | +| [CreateSemaphore(string, int)](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int)') | Constructs an [IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') instance with the given [name](IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md#Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string,int).name 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(string, int).name'). | diff --git a/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md b/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md new file mode 100644 index 00000000..b3d94fce --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +## IDistributedSynchronizationHandle.HandleLostToken Property + +Gets a [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') instance which may be used to +monitor whether the handle to the lock is lost before the handle is +disposed. + +For example, this could happen if the lock is backed by a +database and the connection to the database is disrupted. + +Not all lock types support this; those that don't will return [System.Threading.CancellationToken.None](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken.None 'System.Threading.CancellationToken.None') +which can be detected by checking [System.Threading.CancellationToken.CanBeCanceled](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken.CanBeCanceled 'System.Threading.CancellationToken.CanBeCanceled'). + +For lock types that do support this, accessing this property may incur additional +costs, such as polling to detect connectivity loss. + +```csharp +System.Threading.CancellationToken HandleLostToken { get; } +``` + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md b/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md new file mode 100644 index 00000000..953923e2 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedSynchronizationHandle Interface + +A handle to a distributed lock or other synchronization primitive. To unlock/release, +simply dispose the handle. + +```csharp +public interface IDistributedSynchronizationHandle : +System.IDisposable, +System.IAsyncDisposable +``` + +Derived +↳ [IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') + +Implements [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | Gets a [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') instance which may be used to monitor whether the handle to the lock is lost before the handle is disposed. For example, this could happen if the lock is backed by a database and the connection to the database is disrupted. Not all lock types support this; those that don't will return [System.Threading.CancellationToken.None](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken.None 'System.Threading.CancellationToken.None') which can be detected by checking [System.Threading.CancellationToken.CanBeCanceled](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken.CanBeCanceled 'System.Threading.CancellationToken.CanBeCanceled'). For lock types that do support this, accessing this property may incur additional costs, such as polling to detect connectivity loss. | diff --git a/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock.MgsbqNeNv0qen0RVQV8MHA.md b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock.MgsbqNeNv0qen0RVQV8MHA.md new file mode 100644 index 00000000..864e1194 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock.MgsbqNeNv0qen0RVQV8MHA.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') + +## IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock(Nullable, CancellationToken) Method + +Acquires an UPGRADE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +using (myLock.AcquireUpgradeableReadLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +Medallion.Threading.IDistributedLockUpgradeableHandle AcquireUpgradeableReadLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') +An [IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync.XDD/LbfIJrScMNU14D5OvA.md b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync.XDD/LbfIJrScMNU14D5OvA.md new file mode 100644 index 00000000..e001e754 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync.XDD/LbfIJrScMNU14D5OvA.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') + +## IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync(Nullable, CancellationToken) Method + +Acquires an UPGRADE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireUpgradeableReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +System.Threading.Tasks.ValueTask AcquireUpgradeableReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock.NcomTiK4v4VsrD5p8zrY6A.md b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock.NcomTiK4v4VsrD5p8zrY6A.md new file mode 100644 index 00000000..28659989 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock.NcomTiK4v4VsrD5p8zrY6A.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') + +## IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken) Method + +Attempts to acquire an UPGRADE lock synchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireUpgradeableReadLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +Medallion.Threading.IDistributedLockUpgradeableHandle? TryAcquireUpgradeableReadLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') +An [IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync.NeQQ4jMkCO0IteXQSJv/1w.md b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync.NeQQ4jMkCO0IteXQSJv/1w.md new file mode 100644 index 00000000..1793a755 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync.NeQQ4jMkCO0IteXQSJv/1w.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') + +## IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire an UPGRADE lock asynchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireUpgradeableReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +System.Threading.Tasks.ValueTask TryAcquireUpgradeableReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.md b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.md new file mode 100644 index 00000000..b62695d4 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedUpgradeableReaderWriterLock Interface + +Extends [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') with the ability to take an "upgrade" lock. Like a read lock, an upgrade lock +allows for other concurrent read locks, but not for other upgrade or write locks. However, an upgrade lock can also be upgraded to a write +lock without releasing the underlying handle. + +```csharp +public interface IDistributedUpgradeableReaderWriterLock : +Medallion.Threading.IDistributedReaderWriterLock +``` + +Implements [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +| Methods | | +| :--- | :--- | +| [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock.MgsbqNeNv0qen0RVQV8MHA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)') | Acquires an UPGRADE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [AcquireUpgradeableReadLockAsync(Nullable<TimeSpan>, CancellationToken)](IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync.XDD/LbfIJrScMNU14D5OvA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires an UPGRADE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken)](IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock.NcomTiK4v4VsrD5p8zrY6A.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire an UPGRADE lock synchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken)](IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync.NeQQ4jMkCO0IteXQSJv/1w.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire an UPGRADE lock asynchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | diff --git a/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md new file mode 100644 index 00000000..17e743e2 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading').[IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') + +## IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string) Method + +Constructs an [IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') instance with the given [name](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md#Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string).name 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string).name'). + +```csharp +Medallion.Threading.IDistributedUpgradeableReaderWriterLock CreateUpgradeableReaderWriterLock(string name); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +#### Returns +[IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md new file mode 100644 index 00000000..7ac98370 --- /dev/null +++ b/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Core](README.md 'README') +### [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') + +## IDistributedUpgradeableReaderWriterLockProvider Interface + +Acts as a factory for [IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') instances of a certain type. This interface may be +easier to use than [IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') in dependency injection scenarios. + +```csharp +public interface IDistributedUpgradeableReaderWriterLockProvider : +Medallion.Threading.IDistributedReaderWriterLockProvider +``` + +Implements [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + +| Methods | | +| :--- | :--- | +| [CreateUpgradeableReaderWriterLock(string)](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string)') | Constructs an [IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') instance with the given [name](IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock.CLmVtTtcnh6LtTDHkHXXtQ.md#Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string).name 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider.CreateUpgradeableReaderWriterLock(string).name'). | diff --git a/docs/api/DistributedLock.Core/Medallion.Threading.md b/docs/api/DistributedLock.Core/Medallion.Threading.md new file mode 100644 index 00000000..fd812818 --- /dev/null +++ b/docs/api/DistributedLock.Core/Medallion.Threading.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Core](README.md 'README') + +## Medallion.Threading Namespace + +| Classes | | +| :--- | :--- | +| [DeadlockException](DeadlockException.md 'Medallion.Threading.DeadlockException') | An exception that SOME distributed locks will throw under SOME deadlock conditions. Note that even locks that throw this exception under some circumstances cannot detect ALL deadlock conditions | +| [DistributedLockProviderExtensions](DistributedLockProviderExtensions.md 'Medallion.Threading.DistributedLockProviderExtensions') | Productivity helper methods for [IDistributedLockProvider](IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') | +| [DistributedReaderWriterLockProviderExtensions](DistributedReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedReaderWriterLockProviderExtensions') | Productivity helper methods for [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') | +| [DistributedSemaphoreProviderExtensions](DistributedSemaphoreProviderExtensions.md 'Medallion.Threading.DistributedSemaphoreProviderExtensions') | Productivity helper methods for [IDistributedSemaphoreProvider](IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') | +| [DistributedUpgradeableReaderWriterLockProviderExtensions](DistributedUpgradeableReaderWriterLockProviderExtensions.md 'Medallion.Threading.DistributedUpgradeableReaderWriterLockProviderExtensions') | Productivity helper methods for [IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') | + +| Interfaces | | +| :--- | :--- | +| [IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') | A mutex synchronization primitive which can be used to coordinate access to a resource or critical region of code across processes or systems. The scope and capabilities of the lock are dependent on the particular implementation | +| [IDistributedLockProvider](IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') | Acts as a factory for [IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') instances of a certain type. This interface may be easier to use than [IDistributedLock](IDistributedLock.md 'Medallion.Threading.IDistributedLock') in dependency injection scenarios. | +| [IDistributedLockUpgradeableHandle](IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') | A [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') that can be upgraded to a write lock | +| [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') | Provides distributed locking functionality comparable to [System.Threading.ReaderWriterLock](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.ReaderWriterLock 'System.Threading.ReaderWriterLock') | +| [IDistributedReaderWriterLockProvider](IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') | Acts as a factory for [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') instances of a certain type. This interface may be easier to use than [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') in dependency injection scenarios. | +| [IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') | A synchronization primitive which restricts access to a resource or critical section of code to a fixed number of concurrent threads/processes. Compare to [System.Threading.Semaphore](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Semaphore 'System.Threading.Semaphore'). | +| [IDistributedSemaphoreProvider](IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') | Acts as a factory for [IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') instances of a certain type. This interface may be easier to use than [IDistributedSemaphore](IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') in dependency injection scenarios. | +| [IDistributedSynchronizationHandle](IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | A handle to a distributed lock or other synchronization primitive. To unlock/release, simply dispose the handle. | +| [IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') | Extends [IDistributedReaderWriterLock](IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') with the ability to take an "upgrade" lock. Like a read lock, an upgrade lock allows for other concurrent read locks, but not for other upgrade or write locks. However, an upgrade lock can also be upgraded to a write lock without releasing the underlying handle. | +| [IDistributedUpgradeableReaderWriterLockProvider](IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') | Acts as a factory for [IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') instances of a certain type. This interface may be easier to use than [IDistributedUpgradeableReaderWriterLock](IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock') in dependency injection scenarios. | diff --git a/docs/api/DistributedLock.Core/README.md b/docs/api/DistributedLock.Core/README.md new file mode 100644 index 00000000..21c48135 --- /dev/null +++ b/docs/api/DistributedLock.Core/README.md @@ -0,0 +1,9 @@ +#### [DistributedLock.Core](README.md 'README') + +## DistributedLock.Core Assembly + +DistributedLock.Core is such a cool library! + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading](Medallion.Threading.md 'Medallion.Threading') | | diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLock..ctor.vNzzxMsPVMiUjD+hEvX7EQ.md b/docs/api/DistributedLock.FileSystem/FileDistributedLock..ctor.vNzzxMsPVMiUjD+hEvX7EQ.md new file mode 100644 index 00000000..1fa23f63 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLock..ctor.vNzzxMsPVMiUjD+hEvX7EQ.md @@ -0,0 +1,23 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') + +## FileDistributedLock(DirectoryInfo, string) Constructor + +Constructs a lock which will place a lock file in [lockFileDirectory](FileDistributedLock..ctor.vNzzxMsPVMiUjD+hEvX7EQ.md#Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo,string).lockFileDirectory 'Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo, string).lockFileDirectory'). The file's name +will be based on [name](FileDistributedLock..ctor.vNzzxMsPVMiUjD+hEvX7EQ.md#Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo,string).name 'Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo, string).name'), but with proper escaping/hashing to ensure that a valid file name is produced. + +Upon acquiring the lock, the file's directory will be created automatically if it does not already exist. The file +will similarly be created if it does not already exist, and will be deleted when the lock is released. + +```csharp +public FileDistributedLock(System.IO.DirectoryInfo lockFileDirectory, string name); +``` +#### Parameters + + + +`lockFileDirectory` [System.IO.DirectoryInfo](https://docs.microsoft.com/en-us/dotnet/api/System.IO.DirectoryInfo 'System.IO.DirectoryInfo') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLock..ctor/N7mTMuqXSs9QBL49fhQcQ.md b/docs/api/DistributedLock.FileSystem/FileDistributedLock..ctor/N7mTMuqXSs9QBL49fhQcQ.md new file mode 100644 index 00000000..5c5c249d --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLock..ctor/N7mTMuqXSs9QBL49fhQcQ.md @@ -0,0 +1,18 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') + +## FileDistributedLock(FileInfo) Constructor + +Constructs a lock which uses the provided [lockFile](FileDistributedLock..ctor./N7mTMuqXSs9QBL49fhQcQ.md#Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.FileInfo).lockFile 'Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.FileInfo).lockFile') as the exact file name. + +Upon acquiring the lock, the file's directory will be created automatically if it does not already exist. The file +will similarly be created if it does not already exist, and will be deleted when the lock is released. + +```csharp +public FileDistributedLock(System.IO.FileInfo lockFile); +``` +#### Parameters + + + +`lockFile` [System.IO.FileInfo](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileInfo 'System.IO.FileInfo') \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLock.Acquire.Cxe4kn5Dotos0VNT8S7mFg.md b/docs/api/DistributedLock.FileSystem/FileDistributedLock.Acquire.Cxe4kn5Dotos0VNT8S7mFg.md new file mode 100644 index 00000000..97e7755d --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLock.Acquire.Cxe4kn5Dotos0VNT8S7mFg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') + +## FileDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.FileSystem.FileDistributedLockHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') +A [FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLock.AcquireAsync.S5lCsEuKHmzK+f7lUXq+aw.md b/docs/api/DistributedLock.FileSystem/FileDistributedLock.AcquireAsync.S5lCsEuKHmzK+f7lUXq+aw.md new file mode 100644 index 00000000..c8b8f844 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLock.AcquireAsync.S5lCsEuKHmzK+f7lUXq+aw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') + +## FileDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLock.Name.md b/docs/api/DistributedLock.FileSystem/FileDistributedLock.Name.md new file mode 100644 index 00000000..ed0fa14f --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') + +## FileDistributedLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLock.TryAcquire.zN8fZOiOkhzpcu5NxeJk8g.md b/docs/api/DistributedLock.FileSystem/FileDistributedLock.TryAcquire.zN8fZOiOkhzpcu5NxeJk8g.md new file mode 100644 index 00000000..3b9eac62 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLock.TryAcquire.zN8fZOiOkhzpcu5NxeJk8g.md @@ -0,0 +1,37 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') + +## FileDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.FileSystem.FileDistributedLockHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') +A [FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLock.TryAcquireAsync.VuLjCVM0f9HO9kvR8wPWxQ.md b/docs/api/DistributedLock.FileSystem/FileDistributedLock.TryAcquireAsync.VuLjCVM0f9HO9kvR8wPWxQ.md new file mode 100644 index 00000000..5e850fbd --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLock.TryAcquireAsync.VuLjCVM0f9HO9kvR8wPWxQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') + +## FileDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLock.md b/docs/api/DistributedLock.FileSystem/FileDistributedLock.md new file mode 100644 index 00000000..26129dc4 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLock.md @@ -0,0 +1,31 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem') + +## FileDistributedLock Class + +A distributed lock based on holding an exclusive handle to a lock file. The file will be deleted when the lock is released. + +```csharp +public sealed class FileDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 FileDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [FileDistributedLock(DirectoryInfo, string)](FileDistributedLock..ctor.vNzzxMsPVMiUjD+hEvX7EQ.md 'Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo, string)') | Constructs a lock which will place a lock file in [lockFileDirectory](FileDistributedLock..ctor.vNzzxMsPVMiUjD+hEvX7EQ.md#Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo,string).lockFileDirectory 'Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo, string).lockFileDirectory'). The file's name will be based on [name](FileDistributedLock..ctor.vNzzxMsPVMiUjD+hEvX7EQ.md#Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo,string).name 'Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.DirectoryInfo, string).name'), but with proper escaping/hashing to ensure that a valid file name is produced. Upon acquiring the lock, the file's directory will be created automatically if it does not already exist. The file will similarly be created if it does not already exist, and will be deleted when the lock is released. | +| [FileDistributedLock(FileInfo)](FileDistributedLock..ctor./N7mTMuqXSs9QBL49fhQcQ.md 'Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.FileInfo)') | Constructs a lock which uses the provided [lockFile](FileDistributedLock..ctor./N7mTMuqXSs9QBL49fhQcQ.md#Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.FileInfo).lockFile 'Medallion.Threading.FileSystem.FileDistributedLock.FileDistributedLock(System.IO.FileInfo).lockFile') as the exact file name. Upon acquiring the lock, the file's directory will be created automatically if it does not already exist. The file will similarly be created if it does not already exist, and will be deleted when the lock is released. | + +| Properties | | +| :--- | :--- | +| [Name](FileDistributedLock.Name.md 'Medallion.Threading.FileSystem.FileDistributedLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](FileDistributedLock.Acquire.Cxe4kn5Dotos0VNT8S7mFg.md 'Medallion.Threading.FileSystem.FileDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](FileDistributedLock.AcquireAsync.S5lCsEuKHmzK+f7lUXq+aw.md 'Medallion.Threading.FileSystem.FileDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](FileDistributedLock.TryAcquire.zN8fZOiOkhzpcu5NxeJk8g.md 'Medallion.Threading.FileSystem.FileDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](FileDistributedLock.TryAcquireAsync.VuLjCVM0f9HO9kvR8wPWxQ.md 'Medallion.Threading.FileSystem.FileDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.Dispose().md b/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.Dispose().md new file mode 100644 index 00000000..028fdd50 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') + +## FileDistributedLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..d5fbc129 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') + +## FileDistributedLockHandle.DisposeAsync() Method + +Releases the lock + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.md b/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.md new file mode 100644 index 00000000..07e80991 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedLockHandle.md @@ -0,0 +1,22 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem') + +## FileDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class FileDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 FileDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Methods | | +| :--- | :--- | +| [Dispose()](FileDistributedLockHandle.Dispose().md 'Medallion.Threading.FileSystem.FileDistributedLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](FileDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.FileSystem.FileDistributedLockHandle.DisposeAsync()') | Releases the lock | diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider..ctor.TETT6F6M/CskpBpX2hNqtA.md b/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider..ctor.TETT6F6M/CskpBpX2hNqtA.md new file mode 100644 index 00000000..a0b75918 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider..ctor.TETT6F6M/CskpBpX2hNqtA.md @@ -0,0 +1,15 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedSynchronizationProvider](FileDistributedSynchronizationProvider.md 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider') + +## FileDistributedSynchronizationProvider(DirectoryInfo) Constructor + +Constructs a provider that scopes lock files within the provided [lockFileDirectory](FileDistributedSynchronizationProvider..ctor.TETT6F6M/CskpBpX2hNqtA.md#Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.FileDistributedSynchronizationProvider(System.IO.DirectoryInfo).lockFileDirectory 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.FileDistributedSynchronizationProvider(System.IO.DirectoryInfo).lockFileDirectory'). + +```csharp +public FileDistributedSynchronizationProvider(System.IO.DirectoryInfo lockFileDirectory); +``` +#### Parameters + + + +`lockFileDirectory` [System.IO.DirectoryInfo](https://docs.microsoft.com/en-us/dotnet/api/System.IO.DirectoryInfo 'System.IO.DirectoryInfo') \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider.CreateLock.bu/BmarBn5NPtnEydKr3pQ.md b/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider.CreateLock.bu/BmarBn5NPtnEydKr3pQ.md new file mode 100644 index 00000000..ef2e84e8 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider.CreateLock.bu/BmarBn5NPtnEydKr3pQ.md @@ -0,0 +1,20 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem').[FileDistributedSynchronizationProvider](FileDistributedSynchronizationProvider.md 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider') + +## FileDistributedSynchronizationProvider.CreateLock(string) Method + +Constructs a [FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') with the given [name](FileDistributedSynchronizationProvider.CreateLock.bu/BmarBn5NPtnEydKr3pQ.md#Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.CreateLock(string).name 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.CreateLock(string).name'). + +```csharp +public Medallion.Threading.FileSystem.FileDistributedLock CreateLock(string name); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +Implements [CreateLock(string)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(System.String)') + +#### Returns +[FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider.md b/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider.md new file mode 100644 index 00000000..fbe7a8bb --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/FileDistributedSynchronizationProvider.md @@ -0,0 +1,23 @@ +#### [DistributedLock.FileSystem](README.md 'README') +### [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem') + +## FileDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') + +```csharp +public sealed class FileDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 FileDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + +| Constructors | | +| :--- | :--- | +| [FileDistributedSynchronizationProvider(DirectoryInfo)](FileDistributedSynchronizationProvider..ctor.TETT6F6M/CskpBpX2hNqtA.md 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.FileDistributedSynchronizationProvider(System.IO.DirectoryInfo)') | Constructs a provider that scopes lock files within the provided [lockFileDirectory](FileDistributedSynchronizationProvider..ctor.TETT6F6M/CskpBpX2hNqtA.md#Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.FileDistributedSynchronizationProvider(System.IO.DirectoryInfo).lockFileDirectory 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.FileDistributedSynchronizationProvider(System.IO.DirectoryInfo).lockFileDirectory'). | + +| Methods | | +| :--- | :--- | +| [CreateLock(string)](FileDistributedSynchronizationProvider.CreateLock.bu/BmarBn5NPtnEydKr3pQ.md 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.CreateLock(string)') | Constructs a [FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') with the given [name](FileDistributedSynchronizationProvider.CreateLock.bu/BmarBn5NPtnEydKr3pQ.md#Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.CreateLock(string).name 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider.CreateLock(string).name'). | diff --git a/docs/api/DistributedLock.FileSystem/Medallion.Threading.FileSystem.md b/docs/api/DistributedLock.FileSystem/Medallion.Threading.FileSystem.md new file mode 100644 index 00000000..8e31121b --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/Medallion.Threading.FileSystem.md @@ -0,0 +1,9 @@ +#### [DistributedLock.FileSystem](README.md 'README') + +## Medallion.Threading.FileSystem Namespace + +| Classes | | +| :--- | :--- | +| [FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') | A distributed lock based on holding an exclusive handle to a lock file. The file will be deleted when the lock is released. | +| [FileDistributedLockHandle](FileDistributedLockHandle.md 'Medallion.Threading.FileSystem.FileDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [FileDistributedSynchronizationProvider](FileDistributedSynchronizationProvider.md 'Medallion.Threading.FileSystem.FileDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [FileDistributedLock](FileDistributedLock.md 'Medallion.Threading.FileSystem.FileDistributedLock') | diff --git a/docs/api/DistributedLock.FileSystem/README.md b/docs/api/DistributedLock.FileSystem/README.md new file mode 100644 index 00000000..af21cc86 --- /dev/null +++ b/docs/api/DistributedLock.FileSystem/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.FileSystem](README.md 'README') + +## DistributedLock.FileSystem Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.FileSystem](Medallion.Threading.FileSystem.md 'Medallion.Threading.FileSystem') | | diff --git a/docs/api/DistributedLock.MySql/Medallion.Threading.MySql.md b/docs/api/DistributedLock.MySql/Medallion.Threading.MySql.md new file mode 100644 index 00000000..a77d9287 --- /dev/null +++ b/docs/api/DistributedLock.MySql/Medallion.Threading.MySql.md @@ -0,0 +1,10 @@ +#### [DistributedLock.MySql](README.md 'README') + +## Medallion.Threading.MySql Namespace + +| Classes | | +| :--- | :--- | +| [MySqlConnectionOptionsBuilder](MySqlConnectionOptionsBuilder.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder') | Specifies options for connecting to and locking against a MySQL database | +| [MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') | Implements a distributed lock for MySQL or MariaDB based on the GET_LOCK family of functions | +| [MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [MySqlDistributedSynchronizationProvider](MySqlDistributedSynchronizationProvider.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') | diff --git a/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.KeepaliveCadence.UQXLJo99rQgbid2s4ZOgRQ.md b/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.KeepaliveCadence.UQXLJo99rQgbid2s4ZOgRQ.md new file mode 100644 index 00000000..bf8369b1 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.KeepaliveCadence.UQXLJo99rQgbid2s4ZOgRQ.md @@ -0,0 +1,25 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlConnectionOptionsBuilder](MySqlConnectionOptionsBuilder.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder') + +## MySqlConnectionOptionsBuilder.KeepaliveCadence(TimeSpan) Method + +MySQL's wait_timeout system variable determines how long the server will allow a connection to be idle before killing it. +For more information, see https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_wait_timeout. + +To prevent this, this option sets the cadence at which we run a no-op "keepalive" query on a connection that is holding a lock. + +Because MySQL's default for this setting is 8 hours, the default [keepaliveCadence](MySqlConnectionOptionsBuilder.KeepaliveCadence.UQXLJo99rQgbid2s4ZOgRQ.md#Medallion.Threading.MySql.MySqlConnectionOptionsBuilder.KeepaliveCadence(System.TimeSpan).keepaliveCadence 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder.KeepaliveCadence(System.TimeSpan).keepaliveCadence') is 3.5 hours. + +Setting a value of [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') disables keepalive. + +```csharp +public Medallion.Threading.MySql.MySqlConnectionOptionsBuilder KeepaliveCadence(System.TimeSpan keepaliveCadence); +``` +#### Parameters + + + +`keepaliveCadence` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[MySqlConnectionOptionsBuilder](MySqlConnectionOptionsBuilder.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.UseMultiplexing.fKIzw1BfXbV8NLqGfoikqw.md b/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.UseMultiplexing.fKIzw1BfXbV8NLqGfoikqw.md new file mode 100644 index 00000000..0ad5d4f2 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.UseMultiplexing.fKIzw1BfXbV8NLqGfoikqw.md @@ -0,0 +1,31 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlConnectionOptionsBuilder](MySqlConnectionOptionsBuilder.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder') + +## MySqlConnectionOptionsBuilder.UseMultiplexing(bool) Method + +This mode takes advantage of the fact that while "holding" a lock (or other synchronization primitive) +a connection is essentially idle. Thus, rather than creating a new connection for each held lock it is +often possible to multiplex a shared connection so that that connection can hold multiple locks at the same time. + +Multiplexing is on by default. + +This is implemented in such a way that releasing a lock held on such a connection will never be blocked by an +Acquire() call that is waiting to acquire a lock on that same connection. For this reason, the multiplexing +strategy is "optimistic": if the lock can't be acquired instantaneously on the shared connection, a new (shareable) +connection will be allocated. + +This option can improve performance and avoid connection pool starvation in high-load scenarios. It is also +particularly applicable to cases where [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') +semantics are used with a zero-length timeout. + +```csharp +public Medallion.Threading.MySql.MySqlConnectionOptionsBuilder UseMultiplexing(bool useMultiplexing=true); +``` +#### Parameters + + + +`useMultiplexing` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[MySqlConnectionOptionsBuilder](MySqlConnectionOptionsBuilder.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.md b/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.md new file mode 100644 index 00000000..2e6f07d7 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlConnectionOptionsBuilder.md @@ -0,0 +1,17 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql') + +## MySqlConnectionOptionsBuilder Class + +Specifies options for connecting to and locking against a MySQL database + +```csharp +public sealed class MySqlConnectionOptionsBuilder +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 MySqlConnectionOptionsBuilder + +| Methods | | +| :--- | :--- | +| [KeepaliveCadence(TimeSpan)](MySqlConnectionOptionsBuilder.KeepaliveCadence.UQXLJo99rQgbid2s4ZOgRQ.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder.KeepaliveCadence(System.TimeSpan)') | MySQL's wait_timeout system variable determines how long the server will allow a connection to be idle before killing it. For more information, see https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_wait_timeout. To prevent this, this option sets the cadence at which we run a no-op "keepalive" query on a connection that is holding a lock. Because MySQL's default for this setting is 8 hours, the default [keepaliveCadence](MySqlConnectionOptionsBuilder.KeepaliveCadence.UQXLJo99rQgbid2s4ZOgRQ.md#Medallion.Threading.MySql.MySqlConnectionOptionsBuilder.KeepaliveCadence(System.TimeSpan).keepaliveCadence 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder.KeepaliveCadence(System.TimeSpan).keepaliveCadence') is 3.5 hours. Setting a value of [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') disables keepalive. | +| [UseMultiplexing(bool)](MySqlConnectionOptionsBuilder.UseMultiplexing.fKIzw1BfXbV8NLqGfoikqw.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder.UseMultiplexing(bool)') | This mode takes advantage of the fact that while "holding" a lock (or other synchronization primitive) a connection is essentially idle. Thus, rather than creating a new connection for each held lock it is often possible to multiplex a shared connection so that that connection can hold multiple locks at the same time. Multiplexing is on by default. This is implemented in such a way that releasing a lock held on such a connection will never be blocked by an Acquire() call that is waiting to acquire a lock on that same connection. For this reason, the multiplexing strategy is "optimistic": if the lock can't be acquired instantaneously on the shared connection, a new (shareable) connection will be allocated. This option can improve performance and avoid connection pool starvation in high-load scenarios. It is also particularly applicable to cases where [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') semantics are used with a zero-length timeout. | diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md new file mode 100644 index 00000000..96ee2f36 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md @@ -0,0 +1,28 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +## MySqlDistributedLock(string, IDbTransaction, bool) Constructor + +Constructs a lock with the given [name](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).name') that connects using the connection from the provided [transaction](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).transaction 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).transaction'). + +NOTE that the lock will not be scoped to the [transaction](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).transaction 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).transaction') and must still be explicitly released before the transaction ends. +However, this constructor allows the lock to PARTICIPATE in an ongoing transaction on a connection. + +Unless [exactName](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).exactName 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).exactName') is specified, [name](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public MySqlDistributedLock(string name, System.Data.IDbTransaction transaction, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`transaction` [System.Data.IDbTransaction](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction 'System.Data.IDbTransaction') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md new file mode 100644 index 00000000..ebeb82a0 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md @@ -0,0 +1,25 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +## MySqlDistributedLock(string, IDbConnection, bool) Constructor + +Constructs a lock with the given [name](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool).name') that connects using the provided [connection](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool).connection'). + +Unless [exactName](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public MySqlDistributedLock(string name, System.Data.IDbConnection connection, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md new file mode 100644 index 00000000..bdfad860 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md @@ -0,0 +1,30 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +## MySqlDistributedLock(string, string, Action, bool) Constructor + +Constructs a lock with the given [name](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).name') that connects using the provided [connectionString](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).connectionString') and +[options](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).options 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).options'). + +Unless [exactName](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).exactName') is specified, [name](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public MySqlDistributedLock(string name, string connectionString, System.Action? options=null, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[MySqlConnectionOptionsBuilder](MySqlConnectionOptionsBuilder.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock.Acquire.r/fV/58/g2xfKSkMNPcJIQ.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock.Acquire.r/fV/58/g2xfKSkMNPcJIQ.md new file mode 100644 index 00000000..2087a17e --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock.Acquire.r/fV/58/g2xfKSkMNPcJIQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +## MySqlDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.MySql.MySqlDistributedLockHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') +A [MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock.AcquireAsync.4BoOdZqpZP277VPAU321Nw.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock.AcquireAsync.4BoOdZqpZP277VPAU321Nw.md new file mode 100644 index 00000000..5aacdcf1 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock.AcquireAsync.4BoOdZqpZP277VPAU321Nw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +## MySqlDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock.Name.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock.Name.md new file mode 100644 index 00000000..c385e7d4 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +## MySqlDistributedLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock.TryAcquire.7Uu3aSVcXR87JPC85D/j6w.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock.TryAcquire.7Uu3aSVcXR87JPC85D/j6w.md new file mode 100644 index 00000000..d534e3ce --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock.TryAcquire.7Uu3aSVcXR87JPC85D/j6w.md @@ -0,0 +1,37 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +## MySqlDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.MySql.MySqlDistributedLockHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') +A [MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock.TryAcquireAsync.PuScySfWO2UMl6rfaBoiww.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock.TryAcquireAsync.PuScySfWO2UMl6rfaBoiww.md new file mode 100644 index 00000000..3d7262fc --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock.TryAcquireAsync.PuScySfWO2UMl6rfaBoiww.md @@ -0,0 +1,37 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +## MySqlDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLock.md b/docs/api/DistributedLock.MySql/MySqlDistributedLock.md new file mode 100644 index 00000000..8273b3dc --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLock.md @@ -0,0 +1,32 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql') + +## MySqlDistributedLock Class + +Implements a distributed lock for MySQL or MariaDB based on the GET_LOCK family of functions + +```csharp +public sealed class MySqlDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 MySqlDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [MySqlDistributedLock(string, string, Action<MySqlConnectionOptionsBuilder>, bool)](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool)') | Constructs a lock with the given [name](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).name') that connects using the provided [connectionString](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).connectionString') and [options](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).options 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).options'). Unless [exactName](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).exactName') is specified, [name](MySqlDistributedLock..ctor.PsVoAEVfWkGp+4s0eOgjkA.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. | +| [MySqlDistributedLock(string, IDbConnection, bool)](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool)') | Constructs a lock with the given [name](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool).name') that connects using the provided [connection](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool).connection'). Unless [exactName](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](MySqlDistributedLock..ctor.Gw0JTgvDod2OkXGtyloMgg.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. | +| [MySqlDistributedLock(string, IDbTransaction, bool)](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool)') | Constructs a lock with the given [name](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).name') that connects using the connection from the provided [transaction](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).transaction 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).transaction'). NOTE that the lock will not be scoped to the [transaction](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).transaction 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).transaction') and must still be explicitly released before the transaction ends. However, this constructor allows the lock to PARTICIPATE in an ongoing transaction on a connection. Unless [exactName](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).exactName 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).exactName') is specified, [name](MySqlDistributedLock..ctor.7PfsrTn0xgkLTsBbB0BbVw.md#Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.MySql.MySqlDistributedLock.MySqlDistributedLock(string, System.Data.IDbTransaction, bool).name') will be escaped/hashed to ensure name validity. | + +| Properties | | +| :--- | :--- | +| [Name](MySqlDistributedLock.Name.md 'Medallion.Threading.MySql.MySqlDistributedLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](MySqlDistributedLock.Acquire.r/fV/58/g2xfKSkMNPcJIQ.md 'Medallion.Threading.MySql.MySqlDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](MySqlDistributedLock.AcquireAsync.4BoOdZqpZP277VPAU321Nw.md 'Medallion.Threading.MySql.MySqlDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](MySqlDistributedLock.TryAcquire.7Uu3aSVcXR87JPC85D/j6w.md 'Medallion.Threading.MySql.MySqlDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](MySqlDistributedLock.TryAcquireAsync.PuScySfWO2UMl6rfaBoiww.md 'Medallion.Threading.MySql.MySqlDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.Dispose().md b/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.Dispose().md new file mode 100644 index 00000000..519e28a1 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') + +## MySqlDistributedLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..fd822106 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') + +## MySqlDistributedLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.HandleLostToken.md b/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.HandleLostToken.md new file mode 100644 index 00000000..4ae9f02f --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedLockHandle](MySqlDistributedLockHandle.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle') + +## MySqlDistributedLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.md b/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.md new file mode 100644 index 00000000..84c60c41 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedLockHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql') + +## MySqlDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class MySqlDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 MySqlDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](MySqlDistributedLockHandle.HandleLostToken.md 'Medallion.Threading.MySql.MySqlDistributedLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](MySqlDistributedLockHandle.Dispose().md 'Medallion.Threading.MySql.MySqlDistributedLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](MySqlDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.MySql.MySqlDistributedLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor.p7z4Ra8yKm8ddj1YbCV32w.md b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor.p7z4Ra8yKm8ddj1YbCV32w.md new file mode 100644 index 00000000..8cfc4764 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor.p7z4Ra8yKm8ddj1YbCV32w.md @@ -0,0 +1,15 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedSynchronizationProvider](MySqlDistributedSynchronizationProvider.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider') + +## MySqlDistributedSynchronizationProvider(IDbTransaction) Constructor + +Constructs a provider that connects with [transaction](MySqlDistributedSynchronizationProvider..ctor.p7z4Ra8yKm8ddj1YbCV32w.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbTransaction).transaction 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbTransaction).transaction'). + +```csharp +public MySqlDistributedSynchronizationProvider(System.Data.IDbTransaction transaction); +``` +#### Parameters + + + +`transaction` [System.Data.IDbTransaction](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction 'System.Data.IDbTransaction') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor.pke77kyAr68Nsic0RCNm1g.md b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor.pke77kyAr68Nsic0RCNm1g.md new file mode 100644 index 00000000..42e95bd4 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor.pke77kyAr68Nsic0RCNm1g.md @@ -0,0 +1,15 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedSynchronizationProvider](MySqlDistributedSynchronizationProvider.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider') + +## MySqlDistributedSynchronizationProvider(IDbConnection) Constructor + +Constructs a provider that connects with [connection](MySqlDistributedSynchronizationProvider..ctor.pke77kyAr68Nsic0RCNm1g.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbConnection).connection 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbConnection).connection'). + +```csharp +public MySqlDistributedSynchronizationProvider(System.Data.IDbConnection connection); +``` +#### Parameters + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor/nOe7Is6T7o1EV/QK7Yew.md b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor/nOe7Is6T7o1EV/QK7Yew.md new file mode 100644 index 00000000..99c21b1d --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider..ctor/nOe7Is6T7o1EV/QK7Yew.md @@ -0,0 +1,19 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedSynchronizationProvider](MySqlDistributedSynchronizationProvider.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider') + +## MySqlDistributedSynchronizationProvider(string, Action) Constructor + +Constructs a provider that connects with [connectionString](MySqlDistributedSynchronizationProvider..ctor.//nOe7Is6T7o1EV/QK7Yew.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_).connectionString 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](MySqlDistributedSynchronizationProvider..ctor.//nOe7Is6T7o1EV/QK7Yew.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_).options 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string, System.Action).options'). + +```csharp +public MySqlDistributedSynchronizationProvider(string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[MySqlConnectionOptionsBuilder](MySqlConnectionOptionsBuilder.md 'Medallion.Threading.MySql.MySqlConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider.CreateLock.BfFkX376FOT5FK96U7Fr1g.md b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider.CreateLock.BfFkX376FOT5FK96U7Fr1g.md new file mode 100644 index 00000000..195ffac4 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider.CreateLock.BfFkX376FOT5FK96U7Fr1g.md @@ -0,0 +1,23 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql').[MySqlDistributedSynchronizationProvider](MySqlDistributedSynchronizationProvider.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider') + +## MySqlDistributedSynchronizationProvider.CreateLock(string, bool) Method + +Creates a [MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') with the provided [name](MySqlDistributedSynchronizationProvider.CreateLock.BfFkX376FOT5FK96U7Fr1g.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string,bool).name 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string, bool).name'). Unless [exactName](MySqlDistributedSynchronizationProvider.CreateLock.BfFkX376FOT5FK96U7Fr1g.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string,bool).exactName 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string, bool).exactName') +is specified, invalid names will be escaped/hashed. + +```csharp +public Medallion.Threading.MySql.MySqlDistributedLock CreateLock(string name, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider.md b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider.md new file mode 100644 index 00000000..25839810 --- /dev/null +++ b/docs/api/DistributedLock.MySql/MySqlDistributedSynchronizationProvider.md @@ -0,0 +1,25 @@ +#### [DistributedLock.MySql](README.md 'README') +### [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql') + +## MySqlDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') + +```csharp +public sealed class MySqlDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 MySqlDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') + +| Constructors | | +| :--- | :--- | +| [MySqlDistributedSynchronizationProvider(string, Action<MySqlConnectionOptionsBuilder>)](MySqlDistributedSynchronizationProvider..ctor.//nOe7Is6T7o1EV/QK7Yew.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string, System.Action)') | Constructs a provider that connects with [connectionString](MySqlDistributedSynchronizationProvider..ctor.//nOe7Is6T7o1EV/QK7Yew.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_).connectionString 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](MySqlDistributedSynchronizationProvider..ctor.//nOe7Is6T7o1EV/QK7Yew.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.MySql.MySqlConnectionOptionsBuilder_).options 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(string, System.Action).options'). | +| [MySqlDistributedSynchronizationProvider(IDbConnection)](MySqlDistributedSynchronizationProvider..ctor.pke77kyAr68Nsic0RCNm1g.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbConnection)') | Constructs a provider that connects with [connection](MySqlDistributedSynchronizationProvider..ctor.pke77kyAr68Nsic0RCNm1g.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbConnection).connection 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbConnection).connection'). | +| [MySqlDistributedSynchronizationProvider(IDbTransaction)](MySqlDistributedSynchronizationProvider..ctor.p7z4Ra8yKm8ddj1YbCV32w.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbTransaction)') | Constructs a provider that connects with [transaction](MySqlDistributedSynchronizationProvider..ctor.p7z4Ra8yKm8ddj1YbCV32w.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbTransaction).transaction 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.MySqlDistributedSynchronizationProvider(System.Data.IDbTransaction).transaction'). | + +| Methods | | +| :--- | :--- | +| [CreateLock(string, bool)](MySqlDistributedSynchronizationProvider.CreateLock.BfFkX376FOT5FK96U7Fr1g.md 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string, bool)') | Creates a [MySqlDistributedLock](MySqlDistributedLock.md 'Medallion.Threading.MySql.MySqlDistributedLock') with the provided [name](MySqlDistributedSynchronizationProvider.CreateLock.BfFkX376FOT5FK96U7Fr1g.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string,bool).name 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string, bool).name'). Unless [exactName](MySqlDistributedSynchronizationProvider.CreateLock.BfFkX376FOT5FK96U7Fr1g.md#Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string,bool).exactName 'Medallion.Threading.MySql.MySqlDistributedSynchronizationProvider.CreateLock(string, bool).exactName') is specified, invalid names will be escaped/hashed. | diff --git a/docs/api/DistributedLock.MySql/README.md b/docs/api/DistributedLock.MySql/README.md new file mode 100644 index 00000000..e89e09f3 --- /dev/null +++ b/docs/api/DistributedLock.MySql/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.MySql](README.md 'README') + +## DistributedLock.MySql Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.MySql](Medallion.Threading.MySql.md 'Medallion.Threading.MySql') | | diff --git a/docs/api/DistributedLock.Oracle/Medallion.Threading.Oracle.md b/docs/api/DistributedLock.Oracle/Medallion.Threading.Oracle.md new file mode 100644 index 00000000..cb41c30b --- /dev/null +++ b/docs/api/DistributedLock.Oracle/Medallion.Threading.Oracle.md @@ -0,0 +1,13 @@ +#### [DistributedLock.Oracle](README.md 'README') + +## Medallion.Threading.Oracle Namespace + +| Classes | | +| :--- | :--- | +| [OracleConnectionOptionsBuilder](OracleConnectionOptionsBuilder.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder') | Specifies options for connecting to and locking against an Oracle database | +| [OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') | Implements a distributed lock for Oracle databse based on the DBMS_LOCK package | +| [OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') | Implements an upgradeable distributed reader-writer lock for the Oracle database using the DBMS_LOCK package. | +| [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') | Implements [IDistributedLockUpgradeableHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') | +| [OracleDistributedSynchronizationProvider](OracleDistributedSynchronizationProvider.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') and [IDistributedUpgradeableReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') for [OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') | diff --git a/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.KeepaliveCadence.cpYoNdk/QhqJGH/58Hukqw.md b/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.KeepaliveCadence.cpYoNdk/QhqJGH/58Hukqw.md new file mode 100644 index 00000000..2d5613c4 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.KeepaliveCadence.cpYoNdk/QhqJGH/58Hukqw.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleConnectionOptionsBuilder](OracleConnectionOptionsBuilder.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder') + +## OracleConnectionOptionsBuilder.KeepaliveCadence(TimeSpan) Method + +Oracle does not kill idle connections by default, so by default keepalive is disabled (set to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan')). + +However, if you are using the IDLE_TIME setting in Oracle or if your network is dropping connections that are idle holding locks for +a long time, you can set a value for keepalive to prevent this from happening. + +See https://stackoverflow.com/questions/1966247/idle-timeout-parameter-in-oracle. + +```csharp +public Medallion.Threading.Oracle.OracleConnectionOptionsBuilder KeepaliveCadence(System.TimeSpan keepaliveCadence); +``` +#### Parameters + + + +`keepaliveCadence` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[OracleConnectionOptionsBuilder](OracleConnectionOptionsBuilder.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.UseMultiplexing.A+iIKatFl3VDvz/7Q6X3Jg.md b/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.UseMultiplexing.A+iIKatFl3VDvz/7Q6X3Jg.md new file mode 100644 index 00000000..0e32628f --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.UseMultiplexing.A+iIKatFl3VDvz/7Q6X3Jg.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleConnectionOptionsBuilder](OracleConnectionOptionsBuilder.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder') + +## OracleConnectionOptionsBuilder.UseMultiplexing(bool) Method + +This mode takes advantage of the fact that while "holding" a lock (or other synchronization primitive) +a connection is essentially idle. Thus, rather than creating a new connection for each held lock it is +often possible to multiplex a shared connection so that that connection can hold multiple locks at the same time. + +Multiplexing is on by default. + +This is implemented in such a way that releasing a lock held on such a connection will never be blocked by an +Acquire() call that is waiting to acquire a lock on that same connection. For this reason, the multiplexing +strategy is "optimistic": if the lock can't be acquired instantaneously on the shared connection, a new (shareable) +connection will be allocated. + +This option can improve performance and avoid connection pool starvation in high-load scenarios. It is also +particularly applicable to cases where [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') +semantics are used with a zero-length timeout. + +```csharp +public Medallion.Threading.Oracle.OracleConnectionOptionsBuilder UseMultiplexing(bool useMultiplexing=true); +``` +#### Parameters + + + +`useMultiplexing` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[OracleConnectionOptionsBuilder](OracleConnectionOptionsBuilder.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.md b/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.md new file mode 100644 index 00000000..7e8166a1 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleConnectionOptionsBuilder.md @@ -0,0 +1,17 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle') + +## OracleConnectionOptionsBuilder Class + +Specifies options for connecting to and locking against an Oracle database + +```csharp +public sealed class OracleConnectionOptionsBuilder +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 OracleConnectionOptionsBuilder + +| Methods | | +| :--- | :--- | +| [KeepaliveCadence(TimeSpan)](OracleConnectionOptionsBuilder.KeepaliveCadence.cpYoNdk/QhqJGH/58Hukqw.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder.KeepaliveCadence(System.TimeSpan)') | Oracle does not kill idle connections by default, so by default keepalive is disabled (set to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan')). However, if you are using the IDLE_TIME setting in Oracle or if your network is dropping connections that are idle holding locks for a long time, you can set a value for keepalive to prevent this from happening. See https://stackoverflow.com/questions/1966247/idle-timeout-parameter-in-oracle. | +| [UseMultiplexing(bool)](OracleConnectionOptionsBuilder.UseMultiplexing.A+iIKatFl3VDvz/7Q6X3Jg.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder.UseMultiplexing(bool)') | This mode takes advantage of the fact that while "holding" a lock (or other synchronization primitive) a connection is essentially idle. Thus, rather than creating a new connection for each held lock it is often possible to multiplex a shared connection so that that connection can hold multiple locks at the same time. Multiplexing is on by default. This is implemented in such a way that releasing a lock held on such a connection will never be blocked by an Acquire() call that is waiting to acquire a lock on that same connection. For this reason, the multiplexing strategy is "optimistic": if the lock can't be acquired instantaneously on the shared connection, a new (shareable) connection will be allocated. This option can improve performance and avoid connection pool starvation in high-load scenarios. It is also particularly applicable to cases where [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') semantics are used with a zero-length timeout. | diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md new file mode 100644 index 00000000..d463b5b5 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md @@ -0,0 +1,30 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') + +## OracleDistributedLock(string, string, Action, bool) Constructor + +Constructs a lock with the given [name](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).name 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).name') that connects using the provided [connectionString](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).connectionString') and +[options](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).options 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).options'). + +Unless [exactName](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).exactName') is specified, [name](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).name 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public OracleDistributedLock(string name, string connectionString, System.Action? options=null, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[OracleConnectionOptionsBuilder](OracleConnectionOptionsBuilder.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md b/docs/api/DistributedLock.Oracle/OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md new file mode 100644 index 00000000..5a1db908 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md @@ -0,0 +1,25 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') + +## OracleDistributedLock(string, IDbConnection, bool) Constructor + +Constructs a lock with the given [name](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool).name') that connects using the provided [connection](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool).connection'). + +Unless [exactName](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public OracleDistributedLock(string name, System.Data.IDbConnection connection, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLock.Acquire.+4c1n2Rm+XfIwQt9S5GCNA.md b/docs/api/DistributedLock.Oracle/OracleDistributedLock.Acquire.+4c1n2Rm+XfIwQt9S5GCNA.md new file mode 100644 index 00000000..5baab860 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLock.Acquire.+4c1n2Rm+XfIwQt9S5GCNA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') + +## OracleDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Oracle.OracleDistributedLockHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') +An [OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLock.AcquireAsync.DWy8bDbjQOspqGdARG5H5Q.md b/docs/api/DistributedLock.Oracle/OracleDistributedLock.AcquireAsync.DWy8bDbjQOspqGdARG5H5Q.md new file mode 100644 index 00000000..8e85142d --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLock.AcquireAsync.DWy8bDbjQOspqGdARG5H5Q.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') + +## OracleDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLock.Name.md b/docs/api/DistributedLock.Oracle/OracleDistributedLock.Name.md new file mode 100644 index 00000000..7a2bdeb9 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') + +## OracleDistributedLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLock.TryAcquire.jxpTPDKrpAohkKglVpscdw.md b/docs/api/DistributedLock.Oracle/OracleDistributedLock.TryAcquire.jxpTPDKrpAohkKglVpscdw.md new file mode 100644 index 00000000..d220f837 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLock.TryAcquire.jxpTPDKrpAohkKglVpscdw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') + +## OracleDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Oracle.OracleDistributedLockHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') +An [OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLock.TryAcquireAsync.2c/SHuju3pt92jk0aHMPqQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedLock.TryAcquireAsync.2c/SHuju3pt92jk0aHMPqQ.md new file mode 100644 index 00000000..4fa40f0b --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLock.TryAcquireAsync.2c/SHuju3pt92jk0aHMPqQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') + +## OracleDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLock.md b/docs/api/DistributedLock.Oracle/OracleDistributedLock.md new file mode 100644 index 00000000..f13c7b81 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLock.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle') + +## OracleDistributedLock Class + +Implements a distributed lock for Oracle databse based on the DBMS_LOCK package + +```csharp +public sealed class OracleDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 OracleDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [OracleDistributedLock(string, string, Action<OracleConnectionOptionsBuilder>, bool)](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool)') | Constructs a lock with the given [name](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).name 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).name') that connects using the provided [connectionString](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).connectionString') and [options](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).options 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).options'). Unless [exactName](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).exactName') is specified, [name](OracleDistributedLock..ctor.2/b645uSsJRoN1RGNqS0EQ.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).name 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. | +| [OracleDistributedLock(string, IDbConnection, bool)](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool)') | Constructs a lock with the given [name](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool).name') that connects using the provided [connection](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool).connection'). Unless [exactName](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](OracleDistributedLock..ctor.ruFnlqTt8A/yRSLZE0t3dA.md#Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.Oracle.OracleDistributedLock.OracleDistributedLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. | + +| Properties | | +| :--- | :--- | +| [Name](OracleDistributedLock.Name.md 'Medallion.Threading.Oracle.OracleDistributedLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](OracleDistributedLock.Acquire.+4c1n2Rm+XfIwQt9S5GCNA.md 'Medallion.Threading.Oracle.OracleDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](OracleDistributedLock.AcquireAsync.DWy8bDbjQOspqGdARG5H5Q.md 'Medallion.Threading.Oracle.OracleDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](OracleDistributedLock.TryAcquire.jxpTPDKrpAohkKglVpscdw.md 'Medallion.Threading.Oracle.OracleDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](OracleDistributedLock.TryAcquireAsync.2c/SHuju3pt92jk0aHMPqQ.md 'Medallion.Threading.Oracle.OracleDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.Dispose().md b/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.Dispose().md new file mode 100644 index 00000000..42d911f6 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') + +## OracleDistributedLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..c91138fd --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') + +## OracleDistributedLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.HandleLostToken.md b/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.HandleLostToken.md new file mode 100644 index 00000000..7e8d3c6a --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedLockHandle](OracleDistributedLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle') + +## OracleDistributedLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.md b/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.md new file mode 100644 index 00000000..c6e71550 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedLockHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle') + +## OracleDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class OracleDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 OracleDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](OracleDistributedLockHandle.HandleLostToken.md 'Medallion.Threading.Oracle.OracleDistributedLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](OracleDistributedLockHandle.Dispose().md 'Medallion.Threading.Oracle.OracleDistributedLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](OracleDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.Oracle.OracleDistributedLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md new file mode 100644 index 00000000..385edc71 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock(string, string, Action, bool) Constructor + +Constructs a new lock using the provided [name](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).name 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool).name'). + +The provided [connectionString](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool).connectionString') will be used to connect to the database. + +Unless [exactName](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool).exactName') is specified, [name](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).name 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public OracleDistributedReaderWriterLock(string name, string connectionString, System.Action? options=null, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[OracleConnectionOptionsBuilder](OracleConnectionOptionsBuilder.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md new file mode 100644 index 00000000..3739ec83 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md @@ -0,0 +1,28 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock(string, IDbConnection, bool) Constructor + +Constructs a new lock using the provided [name](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).name'). + +The provided [connection](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).connection') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and +will not be opened or closed. + +Unless [exactName](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public OracleDistributedReaderWriterLock(string name, System.Data.IDbConnection connection, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireReadLock.i+1DmU9e9egRXs1g6b3Gpw.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireReadLock.i+1DmU9e9egRXs1g6b3Gpw.md new file mode 100644 index 00000000..4b6b0bbc --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireReadLock.i+1DmU9e9egRXs1g6b3Gpw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.AcquireReadLock(Nullable, CancellationToken) Method + +Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (myLock.AcquireReadLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle AcquireReadLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') +An [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireReadLockAsync.cHH807x/OmDfG5O0jJHDbg.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireReadLockAsync.cHH807x/OmDfG5O0jJHDbg.md new file mode 100644 index 00000000..de647c7c --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireReadLockAsync.cHH807x/OmDfG5O0jJHDbg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.AcquireReadLockAsync(Nullable, CancellationToken) Method + +Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireUpgradeableReadLock.R7oQaBTKIoxOXrOAlSXjVw.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireUpgradeableReadLock.R7oQaBTKIoxOXrOAlSXjVw.md new file mode 100644 index 00000000..2920e431 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireUpgradeableReadLock.R7oQaBTKIoxOXrOAlSXjVw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.AcquireUpgradeableReadLock(Nullable, CancellationToken) Method + +Acquires an UPGRADE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +using (myLock.AcquireUpgradeableReadLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle AcquireUpgradeableReadLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock.MgsbqNeNv0qen0RVQV8MHA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') +An [OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync.ResKtbEYMnwtBr+1n8rCVA.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync.ResKtbEYMnwtBr+1n8rCVA.md new file mode 100644 index 00000000..4545197a --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync.ResKtbEYMnwtBr+1n8rCVA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync(Nullable, CancellationToken) Method + +Acquires an UPGRADE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireUpgradeableReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireUpgradeableReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireUpgradeableReadLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync.XDD/LbfIJrScMNU14D5OvA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireWriteLock.EHh6icCC0sW+KpPfQpbkqw.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireWriteLock.EHh6icCC0sW+KpPfQpbkqw.md new file mode 100644 index 00000000..07e28e96 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireWriteLock.EHh6icCC0sW+KpPfQpbkqw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.AcquireWriteLock(Nullable, CancellationToken) Method + +Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (myLock.AcquireWriteLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle AcquireWriteLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') +An [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireWriteLockAsync.i6hqw6JHp5wzxI8GbW0daA.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireWriteLockAsync.i6hqw6JHp5wzxI8GbW0daA.md new file mode 100644 index 00000000..a116b58d --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.AcquireWriteLockAsync.i6hqw6JHp5wzxI8GbW0daA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.AcquireWriteLockAsync(Nullable, CancellationToken) Method + +Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (await myLock.AcquireWriteLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.Name.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.Name.md new file mode 100644 index 00000000..40398a0f --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireReadLock.hJ8GIzamtceZzMUxp70TPQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireReadLock.hJ8GIzamtceZzMUxp70TPQ.md new file mode 100644 index 00000000..b7c87198 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireReadLock.hJ8GIzamtceZzMUxp70TPQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.TryAcquireReadLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireReadLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle? TryAcquireReadLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') +An [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireReadLockAsync.IEoPoW7dEaZKcc46gq1JiQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireReadLockAsync.IEoPoW7dEaZKcc46gq1JiQ.md new file mode 100644 index 00000000..a04a8ee9 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireReadLockAsync.IEoPoW7dEaZKcc46gq1JiQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.TryAcquireReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLock.pCah2aRljYOlO0JIWgorWA.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLock.pCah2aRljYOlO0JIWgorWA.md new file mode 100644 index 00000000..918e58fb --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLock.pCah2aRljYOlO0JIWgorWA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken) Method + +Attempts to acquire an UPGRADE lock synchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireUpgradeableReadLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle? TryAcquireUpgradeableReadLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock.NcomTiK4v4VsrD5p8zrY6A.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') +An [OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync.21/n2EnWZfs+furVMXeXQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync.21/n2EnWZfs+furVMXeXQ.md new file mode 100644 index 00000000..d3af15cb --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync.21/n2EnWZfs+furVMXeXQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire an UPGRADE lock asynchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireUpgradeableReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireUpgradeableReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync.NeQQ4jMkCO0IteXQSJv/1w.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireWriteLock.z52QOCPLLTcPg/Rkv1mHYQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireWriteLock.z52QOCPLLTcPg/Rkv1mHYQ.md new file mode 100644 index 00000000..3c5cbe63 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireWriteLock.z52QOCPLLTcPg/Rkv1mHYQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.TryAcquireWriteLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireWriteLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle? TryAcquireWriteLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') +An [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireWriteLockAsync.N34kqc/h8laY2Ll0B3qHLA.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireWriteLockAsync.N34kqc/h8laY2Ll0B3qHLA.md new file mode 100644 index 00000000..42a36a7a --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.TryAcquireWriteLockAsync.N34kqc/h8laY2Ll0B3qHLA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +## OracleDistributedReaderWriterLock.TryAcquireWriteLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireWriteLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.md new file mode 100644 index 00000000..2618aa71 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLock.md @@ -0,0 +1,40 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle') + +## OracleDistributedReaderWriterLock Class + +Implements an upgradeable distributed reader-writer lock for the Oracle database using the DBMS_LOCK package. + +```csharp +public sealed class OracleDistributedReaderWriterLock : +Medallion.Threading.IDistributedUpgradeableReaderWriterLock, +Medallion.Threading.IDistributedReaderWriterLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 OracleDistributedReaderWriterLock + +Implements [IDistributedUpgradeableReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock'), [IDistributedReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +| Constructors | | +| :--- | :--- | +| [OracleDistributedReaderWriterLock(string, string, Action<OracleConnectionOptionsBuilder>, bool)](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool)') | Constructs a new lock using the provided [name](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).name 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool).name'). The provided [connectionString](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool).connectionString') will be used to connect to the database. Unless [exactName](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool).exactName') is specified, [name](OracleDistributedReaderWriterLock..ctor.8lBF247l20W+SBlWEwdqmQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_,bool).name 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. | +| [OracleDistributedReaderWriterLock(string, IDbConnection, bool)](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool)') | Constructs a new lock using the provided [name](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).name'). The provided [connection](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).connection') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and will not be opened or closed. Unless [exactName](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](OracleDistributedReaderWriterLock..ctor.JHJcHUumz9o6mcMVD9M0SQ.md#Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.OracleDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. | + +| Properties | | +| :--- | :--- | +| [Name](OracleDistributedReaderWriterLock.Name.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](OracleDistributedReaderWriterLock.AcquireReadLock.i+1DmU9e9egRXs1g6b3Gpw.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](OracleDistributedReaderWriterLock.AcquireReadLockAsync.cHH807x/OmDfG5O0jJHDbg.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](OracleDistributedReaderWriterLock.AcquireUpgradeableReadLock.R7oQaBTKIoxOXrOAlSXjVw.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)') | Acquires an UPGRADE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [AcquireUpgradeableReadLockAsync(Nullable<TimeSpan>, CancellationToken)](OracleDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync.ResKtbEYMnwtBr+1n8rCVA.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires an UPGRADE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](OracleDistributedReaderWriterLock.AcquireWriteLock.EHh6icCC0sW+KpPfQpbkqw.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](OracleDistributedReaderWriterLock.AcquireWriteLockAsync.i6hqw6JHp5wzxI8GbW0daA.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireReadLock(TimeSpan, CancellationToken)](OracleDistributedReaderWriterLock.TryAcquireReadLock.hJ8GIzamtceZzMUxp70TPQ.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](OracleDistributedReaderWriterLock.TryAcquireReadLockAsync.IEoPoW7dEaZKcc46gq1JiQ.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken)](OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLock.pCah2aRljYOlO0JIWgorWA.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire an UPGRADE lock synchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken)](OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync.21//n2EnWZfs+furVMXeXQ.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire an UPGRADE lock asynchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [TryAcquireWriteLock(TimeSpan, CancellationToken)](OracleDistributedReaderWriterLock.TryAcquireWriteLock.z52QOCPLLTcPg/Rkv1mHYQ.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](OracleDistributedReaderWriterLock.TryAcquireWriteLockAsync.N34kqc/h8laY2Ll0B3qHLA.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.Dispose().md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.Dispose().md new file mode 100644 index 00000000..cf848f09 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') + +## OracleDistributedReaderWriterLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.DisposeAsync().md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.DisposeAsync().md new file mode 100644 index 00000000..7a69f104 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') + +## OracleDistributedReaderWriterLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public abstract System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.HandleLostToken.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.HandleLostToken.md new file mode 100644 index 00000000..91231bb5 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') + +## OracleDistributedReaderWriterLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public abstract System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.md new file mode 100644 index 00000000..b644fb91 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockHandle.md @@ -0,0 +1,29 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle') + +## OracleDistributedReaderWriterLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public abstract class OracleDistributedReaderWriterLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 OracleDistributedReaderWriterLockHandle + +Derived +↳ [OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](OracleDistributedReaderWriterLockHandle.HandleLostToken.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](OracleDistributedReaderWriterLockHandle.Dispose().md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](OracleDistributedReaderWriterLockHandle.DisposeAsync().md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.DisposeAsync().md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.DisposeAsync().md new file mode 100644 index 00000000..e62a48d3 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') + +## OracleDistributedReaderWriterLockUpgradeableHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public override System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.HandleLostToken.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.HandleLostToken.md new file mode 100644 index 00000000..80a4156d --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') + +## OracleDistributedReaderWriterLockUpgradeableHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public override System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock/jHol+SIt7DlqMKC8v111g.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock/jHol+SIt7DlqMKC8v111g.md new file mode 100644 index 00000000..260ee3d2 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock/jHol+SIt7DlqMKC8v111g.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') + +## OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock(TimeSpan, CancellationToken) Method + +Implements [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan,System.Threading.CancellationToken)') + +```csharp +public bool TryUpgradeToWriteLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Implements [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync.FgoBDmLlHiktYNvHXL6NPw.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync.FgoBDmLlHiktYNvHXL6NPw.md new file mode 100644 index 00000000..d209e812 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync.FgoBDmLlHiktYNvHXL6NPw.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') + +## OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken) Method + +Implements [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +```csharp +public System.Threading.Tasks.ValueTask TryUpgradeToWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Implements [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock.hWqwyiLC1304nrfXA65g6A.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock.hWqwyiLC1304nrfXA65g6A.md new file mode 100644 index 00000000..9b4e1fcd --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock.hWqwyiLC1304nrfXA65g6A.md @@ -0,0 +1,21 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') + +## OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock(Nullable, CancellationToken) Method + +Implements [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +```csharp +public void UpgradeToWriteLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Implements [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync.NiMBlMvyOdtLajlwUeLO1Q.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync.NiMBlMvyOdtLajlwUeLO1Q.md new file mode 100644 index 00000000..8708a12d --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync.NiMBlMvyOdtLajlwUeLO1Q.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedReaderWriterLockUpgradeableHandle](OracleDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle') + +## OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync(Nullable, CancellationToken) Method + +Implements [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +```csharp +public System.Threading.Tasks.ValueTask UpgradeToWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Implements [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.md b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.md new file mode 100644 index 00000000..bc846184 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedReaderWriterLockUpgradeableHandle.md @@ -0,0 +1,30 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle') + +## OracleDistributedReaderWriterLockUpgradeableHandle Class + +Implements [IDistributedLockUpgradeableHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') + +```csharp +public sealed class OracleDistributedReaderWriterLockUpgradeableHandle : Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle, +Medallion.Threading.IDistributedLockUpgradeableHandle, +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 [OracleDistributedReaderWriterLockHandle](OracleDistributedReaderWriterLockHandle.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockHandle') 🡒 OracleDistributedReaderWriterLockUpgradeableHandle + +Implements [IDistributedLockUpgradeableHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle'), [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](OracleDistributedReaderWriterLockUpgradeableHandle.HandleLostToken.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [DisposeAsync()](OracleDistributedReaderWriterLockUpgradeableHandle.DisposeAsync().md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle.DisposeAsync()') | Releases the lock asynchronously | +| [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock./jHol+SIt7DlqMKC8v111g.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan, System.Threading.CancellationToken)') | Implements [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan,System.Threading.CancellationToken)') | +| [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync.FgoBDmLlHiktYNvHXL6NPw.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Implements [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') | +| [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock.hWqwyiLC1304nrfXA65g6A.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable, System.Threading.CancellationToken)') | Implements [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') | +| [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync.NiMBlMvyOdtLajlwUeLO1Q.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Implements [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') | diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider..ctor.Vs3QzXeKG/WYsARra1TfMA.md b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider..ctor.Vs3QzXeKG/WYsARra1TfMA.md new file mode 100644 index 00000000..741ae486 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider..ctor.Vs3QzXeKG/WYsARra1TfMA.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedSynchronizationProvider](OracleDistributedSynchronizationProvider.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider') + +## OracleDistributedSynchronizationProvider(string, Action) Constructor + +Constructs a provider that connects with [connectionString](OracleDistributedSynchronizationProvider..ctor.Vs3QzXeKG/WYsARra1TfMA.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_).connectionString 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](OracleDistributedSynchronizationProvider..ctor.Vs3QzXeKG/WYsARra1TfMA.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_).options 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string, System.Action).options'). + +```csharp +public OracleDistributedSynchronizationProvider(string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[OracleConnectionOptionsBuilder](OracleConnectionOptionsBuilder.md 'Medallion.Threading.Oracle.OracleConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider..ctor.piz12qaqFtocRjH6VWNIGQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider..ctor.piz12qaqFtocRjH6VWNIGQ.md new file mode 100644 index 00000000..3874d916 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider..ctor.piz12qaqFtocRjH6VWNIGQ.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedSynchronizationProvider](OracleDistributedSynchronizationProvider.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider') + +## OracleDistributedSynchronizationProvider(IDbConnection) Constructor + +Constructs a provider that connects with [connection](OracleDistributedSynchronizationProvider..ctor.piz12qaqFtocRjH6VWNIGQ.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(System.Data.IDbConnection).connection 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(System.Data.IDbConnection).connection'). + +```csharp +public OracleDistributedSynchronizationProvider(System.Data.IDbConnection connection); +``` +#### Parameters + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.CreateLock.7wcJ5e/hOrfQ/3Ylf2MDrw.md b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.CreateLock.7wcJ5e/hOrfQ/3Ylf2MDrw.md new file mode 100644 index 00000000..b9b02064 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.CreateLock.7wcJ5e/hOrfQ/3Ylf2MDrw.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedSynchronizationProvider](OracleDistributedSynchronizationProvider.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider') + +## OracleDistributedSynchronizationProvider.CreateLock(string, bool) Method + +Creates a [OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') with the provided [name](OracleDistributedSynchronizationProvider.CreateLock.7wcJ5e/hOrfQ/3Ylf2MDrw.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string,bool).name 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string, bool).name'). Unless [exactName](OracleDistributedSynchronizationProvider.CreateLock.7wcJ5e/hOrfQ/3Ylf2MDrw.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string, bool).exactName') +is specified, invalid names will be escaped/hashed. + +```csharp +public Medallion.Threading.Oracle.OracleDistributedLock CreateLock(string name, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.CreateReaderWriterLock.c5P1XG9aduRCEZMRz2ynkQ.md b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.CreateReaderWriterLock.c5P1XG9aduRCEZMRz2ynkQ.md new file mode 100644 index 00000000..b9657694 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.CreateReaderWriterLock.c5P1XG9aduRCEZMRz2ynkQ.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle').[OracleDistributedSynchronizationProvider](OracleDistributedSynchronizationProvider.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider') + +## OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool) Method + +Creates a [OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') with the provided [name](OracleDistributedSynchronizationProvider.CreateReaderWriterLock.c5P1XG9aduRCEZMRz2ynkQ.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string,bool).name 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool).name'). Unless [exactName](OracleDistributedSynchronizationProvider.CreateReaderWriterLock.c5P1XG9aduRCEZMRz2ynkQ.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool).exactName') +is specified, invalid names will be escaped/hashed. + +```csharp +public Medallion.Threading.Oracle.OracleDistributedReaderWriterLock CreateReaderWriterLock(string name, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.md b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.md new file mode 100644 index 00000000..29aa7068 --- /dev/null +++ b/docs/api/DistributedLock.Oracle/OracleDistributedSynchronizationProvider.md @@ -0,0 +1,28 @@ +#### [DistributedLock.Oracle](README.md 'README') +### [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle') + +## OracleDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') +and [IDistributedUpgradeableReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') for [OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') + +```csharp +public sealed class OracleDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider, +Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider, +Medallion.Threading.IDistributedReaderWriterLockProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 OracleDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider'), [IDistributedUpgradeableReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider'), [IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + +| Constructors | | +| :--- | :--- | +| [OracleDistributedSynchronizationProvider(string, Action<OracleConnectionOptionsBuilder>)](OracleDistributedSynchronizationProvider..ctor.Vs3QzXeKG/WYsARra1TfMA.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string, System.Action)') | Constructs a provider that connects with [connectionString](OracleDistributedSynchronizationProvider..ctor.Vs3QzXeKG/WYsARra1TfMA.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_).connectionString 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](OracleDistributedSynchronizationProvider..ctor.Vs3QzXeKG/WYsARra1TfMA.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.Oracle.OracleConnectionOptionsBuilder_).options 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(string, System.Action).options'). | +| [OracleDistributedSynchronizationProvider(IDbConnection)](OracleDistributedSynchronizationProvider..ctor.piz12qaqFtocRjH6VWNIGQ.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(System.Data.IDbConnection)') | Constructs a provider that connects with [connection](OracleDistributedSynchronizationProvider..ctor.piz12qaqFtocRjH6VWNIGQ.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(System.Data.IDbConnection).connection 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.OracleDistributedSynchronizationProvider(System.Data.IDbConnection).connection'). | + +| Methods | | +| :--- | :--- | +| [CreateLock(string, bool)](OracleDistributedSynchronizationProvider.CreateLock.7wcJ5e/hOrfQ/3Ylf2MDrw.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string, bool)') | Creates a [OracleDistributedLock](OracleDistributedLock.md 'Medallion.Threading.Oracle.OracleDistributedLock') with the provided [name](OracleDistributedSynchronizationProvider.CreateLock.7wcJ5e/hOrfQ/3Ylf2MDrw.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string,bool).name 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string, bool).name'). Unless [exactName](OracleDistributedSynchronizationProvider.CreateLock.7wcJ5e/hOrfQ/3Ylf2MDrw.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateLock(string, bool).exactName') is specified, invalid names will be escaped/hashed. | +| [CreateReaderWriterLock(string, bool)](OracleDistributedSynchronizationProvider.CreateReaderWriterLock.c5P1XG9aduRCEZMRz2ynkQ.md 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool)') | Creates a [OracleDistributedReaderWriterLock](OracleDistributedReaderWriterLock.md 'Medallion.Threading.Oracle.OracleDistributedReaderWriterLock') with the provided [name](OracleDistributedSynchronizationProvider.CreateReaderWriterLock.c5P1XG9aduRCEZMRz2ynkQ.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string,bool).name 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool).name'). Unless [exactName](OracleDistributedSynchronizationProvider.CreateReaderWriterLock.c5P1XG9aduRCEZMRz2ynkQ.md#Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string,bool).exactName 'Medallion.Threading.Oracle.OracleDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool).exactName') is specified, invalid names will be escaped/hashed. | diff --git a/docs/api/DistributedLock.Oracle/README.md b/docs/api/DistributedLock.Oracle/README.md new file mode 100644 index 00000000..7b3a511e --- /dev/null +++ b/docs/api/DistributedLock.Oracle/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.Oracle](README.md 'README') + +## DistributedLock.Oracle Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.Oracle](Medallion.Threading.Oracle.md 'Medallion.Threading.Oracle') | | diff --git a/docs/api/DistributedLock.Postgres/Medallion.Threading.Postgres.md b/docs/api/DistributedLock.Postgres/Medallion.Threading.Postgres.md new file mode 100644 index 00000000..e0936c57 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/Medallion.Threading.Postgres.md @@ -0,0 +1,16 @@ +#### [DistributedLock.Postgres](README.md 'README') + +## Medallion.Threading.Postgres Namespace + +| Classes | | +| :--- | :--- | +| [PostgresConnectionOptionsBuilder](PostgresConnectionOptionsBuilder.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder') | Specifies options for connecting to and locking against a Postgres database | +| [PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') | Implements a distributed lock using Postgres advisory locks (see https://www.postgresql.org/docs/12/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS) | +| [PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') | Implements a distributed lock using Postgres advisory locks (see https://www.postgresql.org/docs/12/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS) | +| [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [PostgresDistributedSynchronizationProvider](PostgresDistributedSynchronizationProvider.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') and [IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') for [PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock'). | + +| Structs | | +| :--- | :--- | +| [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') | Acts as the "name" of a distributed lock in Postgres. Consists of one 64-bit value or two 32-bit values (the spaces do not overlap). See https://www.postgresql.org/docs/12/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS | diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.LedpDNSMoNGTkn636aYbow.md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.LedpDNSMoNGTkn636aYbow.md new file mode 100644 index 00000000..df038d42 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.LedpDNSMoNGTkn636aYbow.md @@ -0,0 +1,20 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey(int, int) Constructor + +Constructs a key from a pair of 32-bit values. This is a separate key space +than [PostgresAdvisoryLockKey(long)](PostgresAdvisoryLockKey..ctor.zWR+TwIbSGzvQzL9/uWeBQ.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(long)'). + +```csharp +public PostgresAdvisoryLockKey(int key1, int key2); +``` +#### Parameters + + + +`key1` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`key2` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md new file mode 100644 index 00000000..392d6ea6 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md @@ -0,0 +1,27 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey(string, bool) Constructor + +Constructs a key based on a string [name](PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md#Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string,bool).name 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string, bool).name'). + +If the string is of the form "{16-digit hex}" or "{8-digit hex},{8-digit hex}", this will be parsed into numeric keys. + +If the string is an ascii string with 9 or fewer characters, it will be mapped to a key that does not collide with +any other key based on such a string or based on a 32-bit value. + +Other string names will be rejected unless [allowHashing](PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md#Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string,bool).allowHashing 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string, bool).allowHashing') is specified, in which case it will be hashed to +a 64-bit key value. + +```csharp +public PostgresAdvisoryLockKey(string name, bool allowHashing=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`allowHashing` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.zWR+TwIbSGzvQzL9/uWeBQ.md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.zWR+TwIbSGzvQzL9/uWeBQ.md new file mode 100644 index 00000000..d6a108a9 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey..ctor.zWR+TwIbSGzvQzL9/uWeBQ.md @@ -0,0 +1,16 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey(long) Constructor + +Constructs a key from a single 64-bit value. This is a separate key space +than [PostgresAdvisoryLockKey(int, int)](PostgresAdvisoryLockKey..ctor.LedpDNSMoNGTkn636aYbow.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(int, int)'). + +```csharp +public PostgresAdvisoryLockKey(long key); +``` +#### Parameters + + + +`key` [System.Int64](https://docs.microsoft.com/en-us/dotnet/api/System.Int64 'System.Int64') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.Equals.+QU35/RcjHTGcjW0iCLCkA.md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.Equals.+QU35/RcjHTGcjW0iCLCkA.md new file mode 100644 index 00000000..e8cc570c --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.Equals.+QU35/RcjHTGcjW0iCLCkA.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey.Equals(PostgresAdvisoryLockKey) Method + +Implements [System.IEquatable<>.Equals(@0)](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1.Equals#System_IEquatable_1_Equals__0_ 'System.IEquatable`1.Equals(`0)') + +```csharp +public bool Equals(Medallion.Threading.Postgres.PostgresAdvisoryLockKey that); +``` +#### Parameters + + + +`that` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.Equals.hCSLKXsGZ9vchAeOS3hn/Q.md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.Equals.hCSLKXsGZ9vchAeOS3hn/Q.md new file mode 100644 index 00000000..0fead8d4 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.Equals.hCSLKXsGZ9vchAeOS3hn/Q.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey.Equals(object) Method + +Implements [System.Object.Equals(System.Object)](https://docs.microsoft.com/en-us/dotnet/api/System.Object.Equals#System_Object_Equals_System_Object_ 'System.Object.Equals(System.Object)') + +```csharp +public override bool Equals(object obj); +``` +#### Parameters + + + +`obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.GetHashCode().md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.GetHashCode().md new file mode 100644 index 00000000..0b62ccdc --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.GetHashCode().md @@ -0,0 +1,13 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey.GetHashCode() Method + +Implements [System.Object.GetHashCode](https://docs.microsoft.com/en-us/dotnet/api/System.Object.GetHashCode 'System.Object.GetHashCode') + +```csharp +public override int GetHashCode(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.ToString().md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.ToString().md new file mode 100644 index 00000000..f3dd31a9 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.ToString().md @@ -0,0 +1,14 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey.ToString() Method + +Returns a string representation of the key that can be round-tripped through +[PostgresAdvisoryLockKey(string, bool)](PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string, bool)') + +```csharp +public override string ToString(); +``` + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.md new file mode 100644 index 00000000..97288e91 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.md @@ -0,0 +1,32 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres') + +## PostgresAdvisoryLockKey Struct + +Acts as the "name" of a distributed lock in Postgres. Consists of one 64-bit value or two 32-bit values (the spaces do not overlap). +See https://www.postgresql.org/docs/12/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS + +```csharp +public readonly struct PostgresAdvisoryLockKey : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') + +| Constructors | | +| :--- | :--- | +| [PostgresAdvisoryLockKey(int, int)](PostgresAdvisoryLockKey..ctor.LedpDNSMoNGTkn636aYbow.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(int, int)') | Constructs a key from a pair of 32-bit values. This is a separate key space than [PostgresAdvisoryLockKey(long)](PostgresAdvisoryLockKey..ctor.zWR+TwIbSGzvQzL9/uWeBQ.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(long)'). | +| [PostgresAdvisoryLockKey(long)](PostgresAdvisoryLockKey..ctor.zWR+TwIbSGzvQzL9/uWeBQ.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(long)') | Constructs a key from a single 64-bit value. This is a separate key space than [PostgresAdvisoryLockKey(int, int)](PostgresAdvisoryLockKey..ctor.LedpDNSMoNGTkn636aYbow.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(int, int)'). | +| [PostgresAdvisoryLockKey(string, bool)](PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string, bool)') | Constructs a key based on a string [name](PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md#Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string,bool).name 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string, bool).name'). If the string is of the form "{16-digit hex}" or "{8-digit hex},{8-digit hex}", this will be parsed into numeric keys. If the string is an ascii string with 9 or fewer characters, it will be mapped to a key that does not collide with any other key based on such a string or based on a 32-bit value. Other string names will be rejected unless [allowHashing](PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md#Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string,bool).allowHashing 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string, bool).allowHashing') is specified, in which case it will be hashed to a 64-bit key value. | + +| Methods | | +| :--- | :--- | +| [Equals(PostgresAdvisoryLockKey)](PostgresAdvisoryLockKey.Equals.+QU35/RcjHTGcjW0iCLCkA.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.Equals(Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') | Implements [System.IEquatable<>.Equals(@0)](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1.Equals#System_IEquatable_1_Equals__0_ 'System.IEquatable`1.Equals(`0)') | +| [Equals(object)](PostgresAdvisoryLockKey.Equals.hCSLKXsGZ9vchAeOS3hn/Q.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.Equals(object)') | Implements [System.Object.Equals(System.Object)](https://docs.microsoft.com/en-us/dotnet/api/System.Object.Equals#System_Object_Equals_System_Object_ 'System.Object.Equals(System.Object)') | +| [GetHashCode()](PostgresAdvisoryLockKey.GetHashCode().md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.GetHashCode()') | Implements [System.Object.GetHashCode](https://docs.microsoft.com/en-us/dotnet/api/System.Object.GetHashCode 'System.Object.GetHashCode') | +| [ToString()](PostgresAdvisoryLockKey.ToString().md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.ToString()') | Returns a string representation of the key that can be round-tripped through [PostgresAdvisoryLockKey(string, bool)](PostgresAdvisoryLockKey..ctor.nrSDuGGKUsKtcB73EU1nXg.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.PostgresAdvisoryLockKey(string, bool)') | + +| Operators | | +| :--- | :--- | +| [operator ==(PostgresAdvisoryLockKey, PostgresAdvisoryLockKey)](PostgresAdvisoryLockKey.op_Equality.WzLfN5crVgBoMiN0RMIAhA.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.op_Equality(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') | Provides equality based on [Equals(PostgresAdvisoryLockKey)](PostgresAdvisoryLockKey.Equals.+QU35/RcjHTGcjW0iCLCkA.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.Equals(Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') | +| [operator !=(PostgresAdvisoryLockKey, PostgresAdvisoryLockKey)](PostgresAdvisoryLockKey.op_Inequality.QLx2INIQzAIzn1yA2+FG0Q.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.op_Inequality(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') | Provides inequality based on [Equals(PostgresAdvisoryLockKey)](PostgresAdvisoryLockKey.Equals.+QU35/RcjHTGcjW0iCLCkA.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.Equals(Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') | diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.op_Equality.WzLfN5crVgBoMiN0RMIAhA.md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.op_Equality.WzLfN5crVgBoMiN0RMIAhA.md new file mode 100644 index 00000000..5ce42caf --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.op_Equality.WzLfN5crVgBoMiN0RMIAhA.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey.operator ==(PostgresAdvisoryLockKey, PostgresAdvisoryLockKey) Operator + +Provides equality based on [Equals(PostgresAdvisoryLockKey)](PostgresAdvisoryLockKey.Equals.+QU35/RcjHTGcjW0iCLCkA.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.Equals(Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') + +```csharp +public static bool operator ==(Medallion.Threading.Postgres.PostgresAdvisoryLockKey a, Medallion.Threading.Postgres.PostgresAdvisoryLockKey b); +``` +#### Parameters + + + +`a` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + + + +`b` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.op_Inequality.QLx2INIQzAIzn1yA2+FG0Q.md b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.op_Inequality.QLx2INIQzAIzn1yA2+FG0Q.md new file mode 100644 index 00000000..7328789d --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresAdvisoryLockKey.op_Inequality.QLx2INIQzAIzn1yA2+FG0Q.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +## PostgresAdvisoryLockKey.operator !=(PostgresAdvisoryLockKey, PostgresAdvisoryLockKey) Operator + +Provides inequality based on [Equals(PostgresAdvisoryLockKey)](PostgresAdvisoryLockKey.Equals.+QU35/RcjHTGcjW0iCLCkA.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey.Equals(Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') + +```csharp +public static bool operator !=(Medallion.Threading.Postgres.PostgresAdvisoryLockKey a, Medallion.Threading.Postgres.PostgresAdvisoryLockKey b); +``` +#### Parameters + + + +`a` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + + + +`b` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.KeepaliveCadence.3nQNyNVWx1MTQ4W8SFqI9w.md b/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.KeepaliveCadence.3nQNyNVWx1MTQ4W8SFqI9w.md new file mode 100644 index 00000000..5f1f8e4a --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.KeepaliveCadence.3nQNyNVWx1MTQ4W8SFqI9w.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresConnectionOptionsBuilder](PostgresConnectionOptionsBuilder.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder') + +## PostgresConnectionOptionsBuilder.KeepaliveCadence(TimeSpan) Method + +Some Postgres setups have automation in place which aggressively kills idle connections. + +To prevent this, this option sets the cadence at which we run a no-op "keepalive" query on a connection that is holding a lock. +Note that this still does not guarantee protection for the connection from all conditions where the governor might kill it. + +Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan'), which disables keepalive. + +```csharp +public Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder KeepaliveCadence(System.TimeSpan keepaliveCadence); +``` +#### Parameters + + + +`keepaliveCadence` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[PostgresConnectionOptionsBuilder](PostgresConnectionOptionsBuilder.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.UseMultiplexing.iaWbIbzQ+9I/FdhQ+S89ng.md b/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.UseMultiplexing.iaWbIbzQ+9I/FdhQ+S89ng.md new file mode 100644 index 00000000..56e7b1fb --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.UseMultiplexing.iaWbIbzQ+9I/FdhQ+S89ng.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresConnectionOptionsBuilder](PostgresConnectionOptionsBuilder.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder') + +## PostgresConnectionOptionsBuilder.UseMultiplexing(bool) Method + +This mode takes advantage of the fact that while "holding" a lock (or other synchronization primitive) +a connection is essentially idle. Thus, rather than creating a new connection for each held lock it is +often possible to multiplex a shared connection so that that connection can hold multiple locks at the same time. + +Multiplexing is on by default. + +This is implemented in such a way that releasing a lock held on such a connection will never be blocked by an +Acquire() call that is waiting to acquire a lock on that same connection. For this reason, the multiplexing +strategy is "optimistic": if the lock can't be acquired instantaneously on the shared connection, a new (shareable) +connection will be allocated. + +This option can improve performance and avoid connection pool starvation in high-load scenarios. It is also +particularly applicable to cases where [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') +semantics are used with a zero-length timeout. + +```csharp +public Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder UseMultiplexing(bool useMultiplexing=true); +``` +#### Parameters + + + +`useMultiplexing` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[PostgresConnectionOptionsBuilder](PostgresConnectionOptionsBuilder.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.md b/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.md new file mode 100644 index 00000000..b1e397e9 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresConnectionOptionsBuilder.md @@ -0,0 +1,17 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres') + +## PostgresConnectionOptionsBuilder Class + +Specifies options for connecting to and locking against a Postgres database + +```csharp +public sealed class PostgresConnectionOptionsBuilder +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 PostgresConnectionOptionsBuilder + +| Methods | | +| :--- | :--- | +| [KeepaliveCadence(TimeSpan)](PostgresConnectionOptionsBuilder.KeepaliveCadence.3nQNyNVWx1MTQ4W8SFqI9w.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder.KeepaliveCadence(System.TimeSpan)') | Some Postgres setups have automation in place which aggressively kills idle connections. To prevent this, this option sets the cadence at which we run a no-op "keepalive" query on a connection that is holding a lock. Note that this still does not guarantee protection for the connection from all conditions where the governor might kill it. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan'), which disables keepalive. | +| [UseMultiplexing(bool)](PostgresConnectionOptionsBuilder.UseMultiplexing.iaWbIbzQ+9I/FdhQ+S89ng.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder.UseMultiplexing(bool)') | This mode takes advantage of the fact that while "holding" a lock (or other synchronization primitive) a connection is essentially idle. Thus, rather than creating a new connection for each held lock it is often possible to multiplex a shared connection so that that connection can hold multiple locks at the same time. Multiplexing is on by default. This is implemented in such a way that releasing a lock held on such a connection will never be blocked by an Acquire() call that is waiting to acquire a lock on that same connection. For this reason, the multiplexing strategy is "optimistic": if the lock can't be acquired instantaneously on the shared connection, a new (shareable) connection will be allocated. This option can improve performance and avoid connection pool starvation in high-load scenarios. It is also particularly applicable to cases where [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') semantics are used with a zero-length timeout. | diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLock..ctor.WrNsj1JRkAGtaHLdHnRFrg.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLock..ctor.WrNsj1JRkAGtaHLdHnRFrg.md new file mode 100644 index 00000000..23b4973b --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLock..ctor.WrNsj1JRkAGtaHLdHnRFrg.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') + +## PostgresDistributedLock(PostgresAdvisoryLockKey, IDbConnection) Constructor + +Constructs a lock with the given [key](PostgresDistributedLock..ctor.WrNsj1JRkAGtaHLdHnRFrg.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,System.Data.IDbConnection).key 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection).key') (effectively the lock name) and [connection](PostgresDistributedLock..ctor.WrNsj1JRkAGtaHLdHnRFrg.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,System.Data.IDbConnection).connection 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection).connection'). + +```csharp +public PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey key, System.Data.IDbConnection connection); +``` +#### Parameters + + + +`key` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md new file mode 100644 index 00000000..ea8668a9 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') + +## PostgresDistributedLock(PostgresAdvisoryLockKey, string, Action) Constructor + +Constructs a lock with the given [key](PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).key 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).key') (effectively the lock name), [connectionString](PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).connectionString 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).connectionString'), +and [options](PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).options 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).options') + +```csharp +public PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey key, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`key` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[PostgresConnectionOptionsBuilder](PostgresConnectionOptionsBuilder.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLock.Acquire.wevmsPrIfDcimdIlhBziiw.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.Acquire.wevmsPrIfDcimdIlhBziiw.md new file mode 100644 index 00000000..97677c40 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.Acquire.wevmsPrIfDcimdIlhBziiw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') + +## PostgresDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Postgres.PostgresDistributedLockHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') +A [PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLock.AcquireAsync.Vmz1wx/1suZB7AWMDkEWqA.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.AcquireAsync.Vmz1wx/1suZB7AWMDkEWqA.md new file mode 100644 index 00000000..9f6d09cd --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.AcquireAsync.Vmz1wx/1suZB7AWMDkEWqA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') + +## PostgresDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLock.Key.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.Key.md new file mode 100644 index 00000000..7f80fda6 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.Key.md @@ -0,0 +1,13 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') + +## PostgresDistributedLock.Key Property + +The [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') that uniquely identifies the lock on the database + +```csharp +public Medallion.Threading.Postgres.PostgresAdvisoryLockKey Key { get; } +``` + +#### Property Value +[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLock.TryAcquire.m+KJTn2pfMV+kQiMfrpLuQ.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.TryAcquire.m+KJTn2pfMV+kQiMfrpLuQ.md new file mode 100644 index 00000000..b60447be --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.TryAcquire.m+KJTn2pfMV+kQiMfrpLuQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') + +## PostgresDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Postgres.PostgresDistributedLockHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') +A [PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLock.TryAcquireAsync.vpSo9yMiuK1NYo8xC2ACUw.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.TryAcquireAsync.vpSo9yMiuK1NYo8xC2ACUw.md new file mode 100644 index 00000000..ec162b3f --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.TryAcquireAsync.vpSo9yMiuK1NYo8xC2ACUw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') + +## PostgresDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLock.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.md new file mode 100644 index 00000000..1b6057bb --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLock.md @@ -0,0 +1,32 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres') + +## PostgresDistributedLock Class + +Implements a distributed lock using Postgres advisory locks +(see https://www.postgresql.org/docs/12/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS) + +```csharp +public sealed class PostgresDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 PostgresDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [PostgresDistributedLock(PostgresAdvisoryLockKey, string, Action<PostgresConnectionOptionsBuilder>)](PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action)') | Constructs a lock with the given [key](PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).key 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).key') (effectively the lock name), [connectionString](PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).connectionString 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).connectionString'), and [options](PostgresDistributedLock..ctor.zD9lmiuiSMIu1mI+FfWXDQ.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).options 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).options') | +| [PostgresDistributedLock(PostgresAdvisoryLockKey, IDbConnection)](PostgresDistributedLock..ctor.WrNsj1JRkAGtaHLdHnRFrg.md 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection)') | Constructs a lock with the given [key](PostgresDistributedLock..ctor.WrNsj1JRkAGtaHLdHnRFrg.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,System.Data.IDbConnection).key 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection).key') (effectively the lock name) and [connection](PostgresDistributedLock..ctor.WrNsj1JRkAGtaHLdHnRFrg.md#Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,System.Data.IDbConnection).connection 'Medallion.Threading.Postgres.PostgresDistributedLock.PostgresDistributedLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection).connection'). | + +| Properties | | +| :--- | :--- | +| [Key](PostgresDistributedLock.Key.md 'Medallion.Threading.Postgres.PostgresDistributedLock.Key') | The [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') that uniquely identifies the lock on the database | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](PostgresDistributedLock.Acquire.wevmsPrIfDcimdIlhBziiw.md 'Medallion.Threading.Postgres.PostgresDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](PostgresDistributedLock.AcquireAsync.Vmz1wx/1suZB7AWMDkEWqA.md 'Medallion.Threading.Postgres.PostgresDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](PostgresDistributedLock.TryAcquire.m+KJTn2pfMV+kQiMfrpLuQ.md 'Medallion.Threading.Postgres.PostgresDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](PostgresDistributedLock.TryAcquireAsync.vpSo9yMiuK1NYo8xC2ACUw.md 'Medallion.Threading.Postgres.PostgresDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.Dispose().md b/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.Dispose().md new file mode 100644 index 00000000..6aed5361 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') + +## PostgresDistributedLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..a2ef5f65 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') + +## PostgresDistributedLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.HandleLostToken.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.HandleLostToken.md new file mode 100644 index 00000000..50c67bfe --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedLockHandle](PostgresDistributedLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle') + +## PostgresDistributedLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.md b/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.md new file mode 100644 index 00000000..1ae6b2df --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedLockHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres') + +## PostgresDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class PostgresDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 PostgresDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](PostgresDistributedLockHandle.HandleLostToken.md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](PostgresDistributedLockHandle.Dispose().md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](PostgresDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.Postgres.PostgresDistributedLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md new file mode 100644 index 00000000..a480214f --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock(PostgresAdvisoryLockKey, string, Action) Constructor + +Constructs a lock with the given [key](PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).key 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).key') (effectively the lock name), [connectionString](PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).connectionString 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).connectionString'), +and [options](PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).options 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).options') + +```csharp +public PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey key, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`key` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[PostgresConnectionOptionsBuilder](PostgresConnectionOptionsBuilder.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock..ctor.W6WkSdoxDDf2G56xXhWE6A.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock..ctor.W6WkSdoxDDf2G56xXhWE6A.md new file mode 100644 index 00000000..8972a1dd --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock..ctor.W6WkSdoxDDf2G56xXhWE6A.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock(PostgresAdvisoryLockKey, IDbConnection) Constructor + +Constructs a lock with the given [key](PostgresDistributedReaderWriterLock..ctor.W6WkSdoxDDf2G56xXhWE6A.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,System.Data.IDbConnection).key 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection).key') (effectively the lock name) and [connection](PostgresDistributedReaderWriterLock..ctor.W6WkSdoxDDf2G56xXhWE6A.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,System.Data.IDbConnection).connection 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection).connection'). + +```csharp +public PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey key, System.Data.IDbConnection connection); +``` +#### Parameters + + + +`key` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireReadLock.F28FR+b8mvglU+XBswMyuw.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireReadLock.F28FR+b8mvglU+XBswMyuw.md new file mode 100644 index 00000000..19ce11c7 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireReadLock.F28FR+b8mvglU+XBswMyuw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.AcquireReadLock(Nullable, CancellationToken) Method + +Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (myLock.AcquireReadLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle AcquireReadLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') +A [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireReadLockAsync.TMCUkzQtH1Cc5G6akBfClw.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireReadLockAsync.TMCUkzQtH1Cc5G6akBfClw.md new file mode 100644 index 00000000..884003c1 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireReadLockAsync.TMCUkzQtH1Cc5G6akBfClw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.AcquireReadLockAsync(Nullable, CancellationToken) Method + +Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireWriteLock.FExQhZC0WBEj7urzZq2J3g.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireWriteLock.FExQhZC0WBEj7urzZq2J3g.md new file mode 100644 index 00000000..edbe68ea --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireWriteLock.FExQhZC0WBEj7urzZq2J3g.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.AcquireWriteLock(Nullable, CancellationToken) Method + +Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (myLock.AcquireWriteLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle AcquireWriteLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') +A [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireWriteLockAsync.idZYzSuwm8J87ACMr/oI1g.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireWriteLockAsync.idZYzSuwm8J87ACMr/oI1g.md new file mode 100644 index 00000000..4c696460 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.AcquireWriteLockAsync.idZYzSuwm8J87ACMr/oI1g.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.AcquireWriteLockAsync(Nullable, CancellationToken) Method + +Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (await myLock.AcquireWriteLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.Key.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.Key.md new file mode 100644 index 00000000..2b3c111d --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.Key.md @@ -0,0 +1,13 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.Key Property + +The [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') that uniquely identifies the lock on the database + +```csharp +public Medallion.Threading.Postgres.PostgresAdvisoryLockKey Key { get; } +``` + +#### Property Value +[PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireReadLock.uH/chMVDaFHN9df7XbbnXg.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireReadLock.uH/chMVDaFHN9df7XbbnXg.md new file mode 100644 index 00000000..a05df5b0 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireReadLock.uH/chMVDaFHN9df7XbbnXg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.TryAcquireReadLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireReadLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle? TryAcquireReadLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') +A [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireReadLockAsync.e4VL9+L71L28yd6spXQ36Q.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireReadLockAsync.e4VL9+L71L28yd6spXQ36Q.md new file mode 100644 index 00000000..e87f3598 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireReadLockAsync.e4VL9+L71L28yd6spXQ36Q.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.TryAcquireReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireWriteLock.apGt13uh3dT6sqhtZGuJ/g.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireWriteLock.apGt13uh3dT6sqhtZGuJ/g.md new file mode 100644 index 00000000..b77a358b --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireWriteLock.apGt13uh3dT6sqhtZGuJ/g.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.TryAcquireWriteLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireWriteLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle? TryAcquireWriteLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') +A [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireWriteLockAsync.KuAeRuowsuEAdyQCqKQqGA.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireWriteLockAsync.KuAeRuowsuEAdyQCqKQqGA.md new file mode 100644 index 00000000..18258109 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.TryAcquireWriteLockAsync.KuAeRuowsuEAdyQCqKQqGA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') + +## PostgresDistributedReaderWriterLock.TryAcquireWriteLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireWriteLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.md new file mode 100644 index 00000000..692b5638 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLock.md @@ -0,0 +1,36 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres') + +## PostgresDistributedReaderWriterLock Class + +Implements a distributed lock using Postgres advisory locks +(see https://www.postgresql.org/docs/12/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS) + +```csharp +public sealed class PostgresDistributedReaderWriterLock : +Medallion.Threading.IDistributedReaderWriterLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 PostgresDistributedReaderWriterLock + +Implements [IDistributedReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +| Constructors | | +| :--- | :--- | +| [PostgresDistributedReaderWriterLock(PostgresAdvisoryLockKey, string, Action<PostgresConnectionOptionsBuilder>)](PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action)') | Constructs a lock with the given [key](PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).key 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).key') (effectively the lock name), [connectionString](PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).connectionString 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).connectionString'), and [options](PostgresDistributedReaderWriterLock..ctor.Gk53rLHLcZCRtaFskSoaPw.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).options 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, string, System.Action).options') | +| [PostgresDistributedReaderWriterLock(PostgresAdvisoryLockKey, IDbConnection)](PostgresDistributedReaderWriterLock..ctor.W6WkSdoxDDf2G56xXhWE6A.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection)') | Constructs a lock with the given [key](PostgresDistributedReaderWriterLock..ctor.W6WkSdoxDDf2G56xXhWE6A.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,System.Data.IDbConnection).key 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection).key') (effectively the lock name) and [connection](PostgresDistributedReaderWriterLock..ctor.W6WkSdoxDDf2G56xXhWE6A.md#Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey,System.Data.IDbConnection).connection 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.PostgresDistributedReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey, System.Data.IDbConnection).connection'). | + +| Properties | | +| :--- | :--- | +| [Key](PostgresDistributedReaderWriterLock.Key.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.Key') | The [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') that uniquely identifies the lock on the database | + +| Methods | | +| :--- | :--- | +| [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](PostgresDistributedReaderWriterLock.AcquireReadLock.F28FR+b8mvglU+XBswMyuw.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](PostgresDistributedReaderWriterLock.AcquireReadLockAsync.TMCUkzQtH1Cc5G6akBfClw.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](PostgresDistributedReaderWriterLock.AcquireWriteLock.FExQhZC0WBEj7urzZq2J3g.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](PostgresDistributedReaderWriterLock.AcquireWriteLockAsync.idZYzSuwm8J87ACMr/oI1g.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireReadLock(TimeSpan, CancellationToken)](PostgresDistributedReaderWriterLock.TryAcquireReadLock.uH/chMVDaFHN9df7XbbnXg.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](PostgresDistributedReaderWriterLock.TryAcquireReadLockAsync.e4VL9+L71L28yd6spXQ36Q.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireWriteLock(TimeSpan, CancellationToken)](PostgresDistributedReaderWriterLock.TryAcquireWriteLock.apGt13uh3dT6sqhtZGuJ/g.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](PostgresDistributedReaderWriterLock.TryAcquireWriteLockAsync.KuAeRuowsuEAdyQCqKQqGA.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.Dispose().md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.Dispose().md new file mode 100644 index 00000000..b593fb89 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') + +## PostgresDistributedReaderWriterLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.DisposeAsync().md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.DisposeAsync().md new file mode 100644 index 00000000..ba2d91d3 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') + +## PostgresDistributedReaderWriterLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.HandleLostToken.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.HandleLostToken.md new file mode 100644 index 00000000..74a3051e --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedReaderWriterLockHandle](PostgresDistributedReaderWriterLockHandle.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle') + +## PostgresDistributedReaderWriterLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.md b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.md new file mode 100644 index 00000000..463b0cb7 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedReaderWriterLockHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres') + +## PostgresDistributedReaderWriterLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class PostgresDistributedReaderWriterLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 PostgresDistributedReaderWriterLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](PostgresDistributedReaderWriterLockHandle.HandleLostToken.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](PostgresDistributedReaderWriterLockHandle.Dispose().md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](PostgresDistributedReaderWriterLockHandle.DisposeAsync().md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider..ctor.ckDCmo/6Rn0lmgbFNQtUvw.md b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider..ctor.ckDCmo/6Rn0lmgbFNQtUvw.md new file mode 100644 index 00000000..285644ba --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider..ctor.ckDCmo/6Rn0lmgbFNQtUvw.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedSynchronizationProvider](PostgresDistributedSynchronizationProvider.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider') + +## PostgresDistributedSynchronizationProvider(IDbConnection) Constructor + +Constructs a provider which connects to Postgres using the provided [connection](PostgresDistributedSynchronizationProvider..ctor.ckDCmo/6Rn0lmgbFNQtUvw.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(System.Data.IDbConnection).connection 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(System.Data.IDbConnection).connection'). + +```csharp +public PostgresDistributedSynchronizationProvider(System.Data.IDbConnection connection); +``` +#### Parameters + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider..ctor.eWR3ijjn8fn/O9iDMaj84A.md b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider..ctor.eWR3ijjn8fn/O9iDMaj84A.md new file mode 100644 index 00000000..7feea992 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider..ctor.eWR3ijjn8fn/O9iDMaj84A.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedSynchronizationProvider](PostgresDistributedSynchronizationProvider.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider') + +## PostgresDistributedSynchronizationProvider(string, Action) Constructor + +Constructs a provider which connects to Postgres using the provided [connectionString](PostgresDistributedSynchronizationProvider..ctor.eWR3ijjn8fn/O9iDMaj84A.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).connectionString 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](PostgresDistributedSynchronizationProvider..ctor.eWR3ijjn8fn/O9iDMaj84A.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).options 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string, System.Action).options'). + +```csharp +public PostgresDistributedSynchronizationProvider(string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[PostgresConnectionOptionsBuilder](PostgresConnectionOptionsBuilder.md 'Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.CreateLock.GJPVJ6V91GLdKcIfqFwqeA.md b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.CreateLock.GJPVJ6V91GLdKcIfqFwqeA.md new file mode 100644 index 00000000..3a11caff --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.CreateLock.GJPVJ6V91GLdKcIfqFwqeA.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedSynchronizationProvider](PostgresDistributedSynchronizationProvider.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider') + +## PostgresDistributedSynchronizationProvider.CreateLock(PostgresAdvisoryLockKey) Method + +Creates a [PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') with the provided [key](PostgresDistributedSynchronizationProvider.CreateLock.GJPVJ6V91GLdKcIfqFwqeA.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey).key 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey).key'). + +```csharp +public Medallion.Threading.Postgres.PostgresDistributedLock CreateLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey key); +``` +#### Parameters + + + +`key` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +#### Returns +[PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.CreateReaderWriterLock.N41hd49fnwW4xwtKSKqA9Q.md b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.CreateReaderWriterLock.N41hd49fnwW4xwtKSKqA9Q.md new file mode 100644 index 00000000..af72380e --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.CreateReaderWriterLock.N41hd49fnwW4xwtKSKqA9Q.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres').[PostgresDistributedSynchronizationProvider](PostgresDistributedSynchronizationProvider.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider') + +## PostgresDistributedSynchronizationProvider.CreateReaderWriterLock(PostgresAdvisoryLockKey) Method + +Creates a [PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') with the provided [key](PostgresDistributedSynchronizationProvider.CreateReaderWriterLock.N41hd49fnwW4xwtKSKqA9Q.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey).key 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey).key'). + +```csharp +public Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock CreateReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey key); +``` +#### Parameters + + + +`key` [PostgresAdvisoryLockKey](PostgresAdvisoryLockKey.md 'Medallion.Threading.Postgres.PostgresAdvisoryLockKey') + +#### Returns +[PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.md b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.md new file mode 100644 index 00000000..7ffb8fd4 --- /dev/null +++ b/docs/api/DistributedLock.Postgres/PostgresDistributedSynchronizationProvider.md @@ -0,0 +1,27 @@ +#### [DistributedLock.Postgres](README.md 'README') +### [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres') + +## PostgresDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') and +[IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') for [PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock'). + +```csharp +public sealed class PostgresDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider, +Medallion.Threading.IDistributedReaderWriterLockProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 PostgresDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider'), [IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') + +| Constructors | | +| :--- | :--- | +| [PostgresDistributedSynchronizationProvider(string, Action<PostgresConnectionOptionsBuilder>)](PostgresDistributedSynchronizationProvider..ctor.eWR3ijjn8fn/O9iDMaj84A.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string, System.Action)') | Constructs a provider which connects to Postgres using the provided [connectionString](PostgresDistributedSynchronizationProvider..ctor.eWR3ijjn8fn/O9iDMaj84A.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).connectionString 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](PostgresDistributedSynchronizationProvider..ctor.eWR3ijjn8fn/O9iDMaj84A.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.Postgres.PostgresConnectionOptionsBuilder_).options 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(string, System.Action).options'). | +| [PostgresDistributedSynchronizationProvider(IDbConnection)](PostgresDistributedSynchronizationProvider..ctor.ckDCmo/6Rn0lmgbFNQtUvw.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(System.Data.IDbConnection)') | Constructs a provider which connects to Postgres using the provided [connection](PostgresDistributedSynchronizationProvider..ctor.ckDCmo/6Rn0lmgbFNQtUvw.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(System.Data.IDbConnection).connection 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.PostgresDistributedSynchronizationProvider(System.Data.IDbConnection).connection'). | + +| Methods | | +| :--- | :--- | +| [CreateLock(PostgresAdvisoryLockKey)](PostgresDistributedSynchronizationProvider.CreateLock.GJPVJ6V91GLdKcIfqFwqeA.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') | Creates a [PostgresDistributedLock](PostgresDistributedLock.md 'Medallion.Threading.Postgres.PostgresDistributedLock') with the provided [key](PostgresDistributedSynchronizationProvider.CreateLock.GJPVJ6V91GLdKcIfqFwqeA.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey).key 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey).key'). | +| [CreateReaderWriterLock(PostgresAdvisoryLockKey)](PostgresDistributedSynchronizationProvider.CreateReaderWriterLock.N41hd49fnwW4xwtKSKqA9Q.md 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey)') | Creates a [PostgresDistributedReaderWriterLock](PostgresDistributedReaderWriterLock.md 'Medallion.Threading.Postgres.PostgresDistributedReaderWriterLock') with the provided [key](PostgresDistributedSynchronizationProvider.CreateReaderWriterLock.N41hd49fnwW4xwtKSKqA9Q.md#Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey).key 'Medallion.Threading.Postgres.PostgresDistributedSynchronizationProvider.CreateReaderWriterLock(Medallion.Threading.Postgres.PostgresAdvisoryLockKey).key'). | diff --git a/docs/api/DistributedLock.Postgres/README.md b/docs/api/DistributedLock.Postgres/README.md new file mode 100644 index 00000000..a0a5d62d --- /dev/null +++ b/docs/api/DistributedLock.Postgres/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.Postgres](README.md 'README') + +## DistributedLock.Postgres Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.Postgres](Medallion.Threading.Postgres.md 'Medallion.Threading.Postgres') | | diff --git a/docs/api/DistributedLock.Redis/Medallion.Threading.Redis.md b/docs/api/DistributedLock.Redis/Medallion.Threading.Redis.md new file mode 100644 index 00000000..26769a2f --- /dev/null +++ b/docs/api/DistributedLock.Redis/Medallion.Threading.Redis.md @@ -0,0 +1,14 @@ +#### [DistributedLock.Redis](README.md 'README') + +## Medallion.Threading.Redis Namespace + +| Classes | | +| :--- | :--- | +| [RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') | Implements a [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') using Redis. Can leverage multiple servers via the RedLock algorithm. | +| [RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') for [RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') | +| [RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') | Implements a [IDistributedReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') using Redis. Can leverage multiple servers via the RedLock algorithm. | +| [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') for [RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') | +| [RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') | Implements a [IDistributedSemaphore](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') using Redis. | +| [RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') for a [RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') | +| [RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') | Options for configuring a redis-based distributed synchronization algorithm | +| [RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock'), [IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') for [RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock'), and [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') for [RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore'). | diff --git a/docs/api/DistributedLock.Redis/README.md b/docs/api/DistributedLock.Redis/README.md new file mode 100644 index 00000000..e73ccd08 --- /dev/null +++ b/docs/api/DistributedLock.Redis/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.Redis](README.md 'README') + +## DistributedLock.Redis Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') | | diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md b/docs/api/DistributedLock.Redis/RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md new file mode 100644 index 00000000..d9777a60 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +## RedisDistributedLock(RedisKey, IEnumerable, Action) Constructor + +Constructs a lock named [key](RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).key 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, System.Collections.Generic.IEnumerable, System.Action).key') using the provided [databases](RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).databases 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, System.Collections.Generic.IEnumerable, System.Action).databases') and [options](RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, System.Collections.Generic.IEnumerable, System.Action).options'). + +```csharp +public RedisDistributedLock(RedisKey key, System.Collections.Generic.IEnumerable databases, System.Action? options=null); +``` +#### Parameters + + + +`key` [StackExchange.Redis.RedisKey](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.RedisKey 'StackExchange.Redis.RedisKey') + + + +`databases` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md b/docs/api/DistributedLock.Redis/RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md new file mode 100644 index 00000000..45fca665 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +## RedisDistributedLock(RedisKey, IDatabase, Action) Constructor + +Constructs a lock named [key](RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).key 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, IDatabase, System.Action).key') using the provided [database](RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).database 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, IDatabase, System.Action).database') and [options](RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, IDatabase, System.Action).options'). + +```csharp +public RedisDistributedLock(RedisKey key, IDatabase database, System.Action? options=null); +``` +#### Parameters + + + +`key` [StackExchange.Redis.RedisKey](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.RedisKey 'StackExchange.Redis.RedisKey') + + + +`database` [StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock.Acquire.AACQakRhT+jw+D9lUnMpvw.md b/docs/api/DistributedLock.Redis/RedisDistributedLock.Acquire.AACQakRhT+jw+D9lUnMpvw.md new file mode 100644 index 00000000..59bc5f5d --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock.Acquire.AACQakRhT+jw+D9lUnMpvw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +## RedisDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Redis.RedisDistributedLockHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') +A [RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock.AcquireAsync/QjYv9rC4HwcQmk9yh4x5g.md b/docs/api/DistributedLock.Redis/RedisDistributedLock.AcquireAsync/QjYv9rC4HwcQmk9yh4x5g.md new file mode 100644 index 00000000..0dfb144c --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock.AcquireAsync/QjYv9rC4HwcQmk9yh4x5g.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +## RedisDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock.Key.md b/docs/api/DistributedLock.Redis/RedisDistributedLock.Key.md new file mode 100644 index 00000000..9a0c606f --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock.Key.md @@ -0,0 +1,13 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +## RedisDistributedLock.Key Property + +The Redis key used to implement the lock + +```csharp +public RedisKey Key { get; } +``` + +#### Property Value +[StackExchange.Redis.RedisKey](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.RedisKey 'StackExchange.Redis.RedisKey') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock.Name.md b/docs/api/DistributedLock.Redis/RedisDistributedLock.Name.md new file mode 100644 index 00000000..f3fa4b5e --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +## RedisDistributedLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock.TryAcquire.XoE9A2OxVcVYbo4P3xgjoQ.md b/docs/api/DistributedLock.Redis/RedisDistributedLock.TryAcquire.XoE9A2OxVcVYbo4P3xgjoQ.md new file mode 100644 index 00000000..70deb6da --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock.TryAcquire.XoE9A2OxVcVYbo4P3xgjoQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +## RedisDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Redis.RedisDistributedLockHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') +A [RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock.TryAcquireAsync.hVlE8jBuI52oxFuu/5kjZQ.md b/docs/api/DistributedLock.Redis/RedisDistributedLock.TryAcquireAsync.hVlE8jBuI52oxFuu/5kjZQ.md new file mode 100644 index 00000000..effdcd3d --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock.TryAcquireAsync.hVlE8jBuI52oxFuu/5kjZQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +## RedisDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLock.md b/docs/api/DistributedLock.Redis/RedisDistributedLock.md new file mode 100644 index 00000000..974cc323 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLock.md @@ -0,0 +1,32 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') + +## RedisDistributedLock Class + +Implements a [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') using Redis. Can leverage multiple servers via the RedLock algorithm. + +```csharp +public sealed class RedisDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 RedisDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [RedisDistributedLock(RedisKey, IDatabase, Action<RedisDistributedSynchronizationOptionsBuilder>)](RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, IDatabase, System.Action)') | Constructs a lock named [key](RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).key 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, IDatabase, System.Action).key') using the provided [database](RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).database 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, IDatabase, System.Action).database') and [options](RedisDistributedLock..ctor.umu5PN9uhldmmDNU7XvM2g.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, IDatabase, System.Action).options'). | +| [RedisDistributedLock(RedisKey, IEnumerable<IDatabase>, Action<RedisDistributedSynchronizationOptionsBuilder>)](RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, System.Collections.Generic.IEnumerable, System.Action)') | Constructs a lock named [key](RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).key 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, System.Collections.Generic.IEnumerable, System.Action).key') using the provided [databases](RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).databases 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, System.Collections.Generic.IEnumerable, System.Action).databases') and [options](RedisDistributedLock..ctor.CAJif2Aj+id/ZDgt9bfHHg.md#Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedLock.RedisDistributedLock(RedisKey, System.Collections.Generic.IEnumerable, System.Action).options'). | + +| Properties | | +| :--- | :--- | +| [Key](RedisDistributedLock.Key.md 'Medallion.Threading.Redis.RedisDistributedLock.Key') | The Redis key used to implement the lock | +| [Name](RedisDistributedLock.Name.md 'Medallion.Threading.Redis.RedisDistributedLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](RedisDistributedLock.Acquire.AACQakRhT+jw+D9lUnMpvw.md 'Medallion.Threading.Redis.RedisDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](RedisDistributedLock.AcquireAsync./QjYv9rC4HwcQmk9yh4x5g.md 'Medallion.Threading.Redis.RedisDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](RedisDistributedLock.TryAcquire.XoE9A2OxVcVYbo4P3xgjoQ.md 'Medallion.Threading.Redis.RedisDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](RedisDistributedLock.TryAcquireAsync.hVlE8jBuI52oxFuu/5kjZQ.md 'Medallion.Threading.Redis.RedisDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.Dispose().md b/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.Dispose().md new file mode 100644 index 00000000..58bc40e5 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') + +## RedisDistributedLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..16ee25a9 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') + +## RedisDistributedLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.HandleLostToken.md b/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.HandleLostToken.md new file mode 100644 index 00000000..460c1e68 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedLockHandle](RedisDistributedLockHandle.md 'Medallion.Threading.Redis.RedisDistributedLockHandle') + +## RedisDistributedLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.md b/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.md new file mode 100644 index 00000000..08bdbe2f --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedLockHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') + +## RedisDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') for [RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') + +```csharp +public sealed class RedisDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 RedisDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](RedisDistributedLockHandle.HandleLostToken.md 'Medallion.Threading.Redis.RedisDistributedLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](RedisDistributedLockHandle.Dispose().md 'Medallion.Threading.Redis.RedisDistributedLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](RedisDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.Redis.RedisDistributedLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md new file mode 100644 index 00000000..1cf1957c --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock(string, IDatabase, Action) Constructor + +Constructs a lock named [name](RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, IDatabase, System.Action).name') using the provided [database](RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).database 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, IDatabase, System.Action).database') and [options](RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, IDatabase, System.Action).options'). + +```csharp +public RedisDistributedReaderWriterLock(string name, IDatabase database, System.Action? options=null); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`database` [StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md new file mode 100644 index 00000000..591b5745 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock(string, IEnumerable, Action) Constructor + +Constructs a lock named [name](RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, System.Collections.Generic.IEnumerable, System.Action).name') using the provided [databases](RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).databases 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, System.Collections.Generic.IEnumerable, System.Action).databases') and [options](RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, System.Collections.Generic.IEnumerable, System.Action).options'). + +```csharp +public RedisDistributedReaderWriterLock(string name, System.Collections.Generic.IEnumerable databases, System.Action? options=null); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`databases` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireReadLock.GS/oxr4gs+xtfk1ETgOWmw.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireReadLock.GS/oxr4gs+xtfk1ETgOWmw.md new file mode 100644 index 00000000..1d98621e --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireReadLock.GS/oxr4gs+xtfk1ETgOWmw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.AcquireReadLock(Nullable, CancellationToken) Method + +Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (myLock.AcquireReadLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle AcquireReadLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') +A [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireReadLockAsync.MulU+rDIiVoqbqS3UTbXAQ.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireReadLockAsync.MulU+rDIiVoqbqS3UTbXAQ.md new file mode 100644 index 00000000..eb4dddb6 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireReadLockAsync.MulU+rDIiVoqbqS3UTbXAQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.AcquireReadLockAsync(Nullable, CancellationToken) Method + +Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireWriteLock.YwKKFoPQWjNEfdJJvQSF/g.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireWriteLock.YwKKFoPQWjNEfdJJvQSF/g.md new file mode 100644 index 00000000..1b0bf655 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireWriteLock.YwKKFoPQWjNEfdJJvQSF/g.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.AcquireWriteLock(Nullable, CancellationToken) Method + +Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (myLock.AcquireWriteLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle AcquireWriteLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') +A [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireWriteLockAsync.c6gUWdEVq8dyvt3FjZ1WHQ.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireWriteLockAsync.c6gUWdEVq8dyvt3FjZ1WHQ.md new file mode 100644 index 00000000..3e16d8ed --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.AcquireWriteLockAsync.c6gUWdEVq8dyvt3FjZ1WHQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.AcquireWriteLockAsync(Nullable, CancellationToken) Method + +Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (await myLock.AcquireWriteLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.Name.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.Name.md new file mode 100644 index 00000000..6b4502c4 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireReadLock.zPT2XvcUGrKdO7gWgH/92A.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireReadLock.zPT2XvcUGrKdO7gWgH/92A.md new file mode 100644 index 00000000..e5eadfad --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireReadLock.zPT2XvcUGrKdO7gWgH/92A.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.TryAcquireReadLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireReadLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle? TryAcquireReadLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') +A [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireReadLockAsync.Yvz5YbbYsaQpJ1VRxOlDbA.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireReadLockAsync.Yvz5YbbYsaQpJ1VRxOlDbA.md new file mode 100644 index 00000000..6ff9206e --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireReadLockAsync.Yvz5YbbYsaQpJ1VRxOlDbA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.TryAcquireReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireWriteLock.4LTOnaHbGBHjx+9nGJBVeA.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireWriteLock.4LTOnaHbGBHjx+9nGJBVeA.md new file mode 100644 index 00000000..53ca7797 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireWriteLock.4LTOnaHbGBHjx+9nGJBVeA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.TryAcquireWriteLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireWriteLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle? TryAcquireWriteLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') +A [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireWriteLockAsync.YImMhMY0HkmT+sGtz+4NHA.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireWriteLockAsync.YImMhMY0HkmT+sGtz+4NHA.md new file mode 100644 index 00000000..a31e4072 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.TryAcquireWriteLockAsync.YImMhMY0HkmT+sGtz+4NHA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +## RedisDistributedReaderWriterLock.TryAcquireWriteLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireWriteLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.md new file mode 100644 index 00000000..e4be264c --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLock.md @@ -0,0 +1,35 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') + +## RedisDistributedReaderWriterLock Class + +Implements a [IDistributedReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') using Redis. Can leverage multiple servers via the RedLock algorithm. + +```csharp +public sealed class RedisDistributedReaderWriterLock : +Medallion.Threading.IDistributedReaderWriterLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 RedisDistributedReaderWriterLock + +Implements [IDistributedReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +| Constructors | | +| :--- | :--- | +| [RedisDistributedReaderWriterLock(string, IDatabase, Action<RedisDistributedSynchronizationOptionsBuilder>)](RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, IDatabase, System.Action)') | Constructs a lock named [name](RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, IDatabase, System.Action).name') using the provided [database](RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).database 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, IDatabase, System.Action).database') and [options](RedisDistributedReaderWriterLock..ctor.UjOB67V/r8BOTbBDgotYOw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, IDatabase, System.Action).options'). | +| [RedisDistributedReaderWriterLock(string, IEnumerable<IDatabase>, Action<RedisDistributedSynchronizationOptionsBuilder>)](RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, System.Collections.Generic.IEnumerable, System.Action)') | Constructs a lock named [name](RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, System.Collections.Generic.IEnumerable, System.Action).name') using the provided [databases](RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).databases 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, System.Collections.Generic.IEnumerable, System.Action).databases') and [options](RedisDistributedReaderWriterLock..ctor.qFVv5NEfnVwOxiU3/Na6Nw.md#Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string,System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.RedisDistributedReaderWriterLock(string, System.Collections.Generic.IEnumerable, System.Action).options'). | + +| Properties | | +| :--- | :--- | +| [Name](RedisDistributedReaderWriterLock.Name.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name') | + +| Methods | | +| :--- | :--- | +| [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](RedisDistributedReaderWriterLock.AcquireReadLock.GS/oxr4gs+xtfk1ETgOWmw.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](RedisDistributedReaderWriterLock.AcquireReadLockAsync.MulU+rDIiVoqbqS3UTbXAQ.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](RedisDistributedReaderWriterLock.AcquireWriteLock.YwKKFoPQWjNEfdJJvQSF/g.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](RedisDistributedReaderWriterLock.AcquireWriteLockAsync.c6gUWdEVq8dyvt3FjZ1WHQ.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireReadLock(TimeSpan, CancellationToken)](RedisDistributedReaderWriterLock.TryAcquireReadLock.zPT2XvcUGrKdO7gWgH/92A.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](RedisDistributedReaderWriterLock.TryAcquireReadLockAsync.Yvz5YbbYsaQpJ1VRxOlDbA.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireWriteLock(TimeSpan, CancellationToken)](RedisDistributedReaderWriterLock.TryAcquireWriteLock.4LTOnaHbGBHjx+9nGJBVeA.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](RedisDistributedReaderWriterLock.TryAcquireWriteLockAsync.YImMhMY0HkmT+sGtz+4NHA.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.Dispose().md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.Dispose().md new file mode 100644 index 00000000..3af99941 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') + +## RedisDistributedReaderWriterLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.DisposeAsync().md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.DisposeAsync().md new file mode 100644 index 00000000..eebdcc36 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') + +## RedisDistributedReaderWriterLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.HandleLostToken.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.HandleLostToken.md new file mode 100644 index 00000000..5a082e81 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedReaderWriterLockHandle](RedisDistributedReaderWriterLockHandle.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle') + +## RedisDistributedReaderWriterLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.md b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.md new file mode 100644 index 00000000..c01bd04d --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedReaderWriterLockHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') + +## RedisDistributedReaderWriterLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') for [RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') + +```csharp +public sealed class RedisDistributedReaderWriterLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 RedisDistributedReaderWriterLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](RedisDistributedReaderWriterLockHandle.HandleLostToken.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](RedisDistributedReaderWriterLockHandle.Dispose().md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](RedisDistributedReaderWriterLockHandle.DisposeAsync().md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md new file mode 100644 index 00000000..7fe407a3 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md @@ -0,0 +1,27 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') + +## RedisDistributedSemaphore(RedisKey, int, IDatabase, Action) Constructor + +Constructs a semaphore named [key](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md#Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey,int,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).key 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action).key') using the provided [maxCount](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md#Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey,int,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).maxCount 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action).maxCount'), [database](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md#Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey,int,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).database 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action).database'), and [options](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md#Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey,int,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action).options'). + +```csharp +public RedisDistributedSemaphore(RedisKey key, int maxCount, IDatabase database, System.Action? options=null); +``` +#### Parameters + + + +`key` [StackExchange.Redis.RedisKey](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.RedisKey 'StackExchange.Redis.RedisKey') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`database` [StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.Acquire.05VsmfQgFRAZncIw+TCkEw.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.Acquire.05VsmfQgFRAZncIw+TCkEw.md new file mode 100644 index 00000000..94740617 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.Acquire.05VsmfQgFRAZncIw+TCkEw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') + +## RedisDistributedSemaphore.Acquire(Nullable, CancellationToken) Method + +Acquires a semaphore ticket synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (mySemaphore.Acquire(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +public Medallion.Threading.Redis.RedisDistributedSemaphoreHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md 'Medallion.Threading.IDistributedSemaphore.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') +A [RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.AcquireAsync.RuA3UY/DINCj0PXg31neVA.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.AcquireAsync.RuA3UY/DINCj0PXg31neVA.md new file mode 100644 index 00000000..8f35f356 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.AcquireAsync.RuA3UY/DINCj0PXg31neVA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') + +## RedisDistributedSemaphore.AcquireAsync(Nullable, CancellationToken) Method + +Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await mySemaphore.AcquireAsync(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md 'Medallion.Threading.IDistributedSemaphore.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.MaxCount.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.MaxCount.md new file mode 100644 index 00000000..ef4d80c7 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.MaxCount.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') + +## RedisDistributedSemaphore.MaxCount Property + +Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') + +```csharp +public int MaxCount { get; } +``` + +Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.Name.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.Name.md new file mode 100644 index 00000000..ebe6f176 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') + +## RedisDistributedSemaphore.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.TryAcquire.gnffYYV8n2g0EsmkoLRNwg.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.TryAcquire.gnffYYV8n2g0EsmkoLRNwg.md new file mode 100644 index 00000000..d42b1c32 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.TryAcquire.gnffYYV8n2g0EsmkoLRNwg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') + +## RedisDistributedSemaphore.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket synchronously. Usage: + +```csharp +using (var handle = mySemaphore.TryAcquire(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +public Medallion.Threading.Redis.RedisDistributedSemaphoreHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md 'Medallion.Threading.IDistributedSemaphore.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') +A [RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.TryAcquireAsync.I7HQi6Sg7LlrmSYRDl9JHQ.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.TryAcquireAsync.I7HQi6Sg7LlrmSYRDl9JHQ.md new file mode 100644 index 00000000..702d9c48 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.TryAcquireAsync.I7HQi6Sg7LlrmSYRDl9JHQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') + +## RedisDistributedSemaphore.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket asynchronously. Usage: + +```csharp +await using (var handle = await mySemaphore.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md 'Medallion.Threading.IDistributedSemaphore.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.md new file mode 100644 index 00000000..81a0dda7 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphore.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') + +## RedisDistributedSemaphore Class + +Implements a [IDistributedSemaphore](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') using Redis. + +```csharp +public sealed class RedisDistributedSemaphore : +Medallion.Threading.IDistributedSemaphore +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 RedisDistributedSemaphore + +Implements [IDistributedSemaphore](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +| Constructors | | +| :--- | :--- | +| [RedisDistributedSemaphore(RedisKey, int, IDatabase, Action<RedisDistributedSynchronizationOptionsBuilder>)](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action)') | Constructs a semaphore named [key](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md#Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey,int,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).key 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action).key') using the provided [maxCount](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md#Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey,int,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).maxCount 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action).maxCount'), [database](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md#Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey,int,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).database 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action).database'), and [options](RedisDistributedSemaphore..ctor.uV7HEVNcvSXDYGL/CEuDZg.md#Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey,int,IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedSemaphore.RedisDistributedSemaphore(RedisKey, int, IDatabase, System.Action).options'). | + +| Properties | | +| :--- | :--- | +| [MaxCount](RedisDistributedSemaphore.MaxCount.md 'Medallion.Threading.Redis.RedisDistributedSemaphore.MaxCount') | Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') | +| [Name](RedisDistributedSemaphore.Name.md 'Medallion.Threading.Redis.RedisDistributedSemaphore.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](RedisDistributedSemaphore.Acquire.05VsmfQgFRAZncIw+TCkEw.md 'Medallion.Threading.Redis.RedisDistributedSemaphore.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](RedisDistributedSemaphore.AcquireAsync.RuA3UY/DINCj0PXg31neVA.md 'Medallion.Threading.Redis.RedisDistributedSemaphore.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](RedisDistributedSemaphore.TryAcquire.gnffYYV8n2g0EsmkoLRNwg.md 'Medallion.Threading.Redis.RedisDistributedSemaphore.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](RedisDistributedSemaphore.TryAcquireAsync.I7HQi6Sg7LlrmSYRDl9JHQ.md 'Medallion.Threading.Redis.RedisDistributedSemaphore.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket asynchronously. Usage: | diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.Dispose().md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.Dispose().md new file mode 100644 index 00000000..b0e1f453 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') + +## RedisDistributedSemaphoreHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.DisposeAsync().md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.DisposeAsync().md new file mode 100644 index 00000000..01218352 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') + +## RedisDistributedSemaphoreHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.HandleLostToken.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.HandleLostToken.md new file mode 100644 index 00000000..4539531c --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSemaphoreHandle](RedisDistributedSemaphoreHandle.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle') + +## RedisDistributedSemaphoreHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.md b/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.md new file mode 100644 index 00000000..d97f5ae8 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSemaphoreHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') + +## RedisDistributedSemaphoreHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') for a [RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') + +```csharp +public sealed class RedisDistributedSemaphoreHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 RedisDistributedSemaphoreHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](RedisDistributedSemaphoreHandle.HandleLostToken.md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](RedisDistributedSemaphoreHandle.Dispose().md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](RedisDistributedSemaphoreHandle.DisposeAsync().md 'Medallion.Threading.Redis.RedisDistributedSemaphoreHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.BusyWaitSleepTime.Z/k+WORQrlfNeKapMJREAw.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.BusyWaitSleepTime.Z/k+WORQrlfNeKapMJREAw.md new file mode 100644 index 00000000..0a8ed74b --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.BusyWaitSleepTime.Z/k+WORQrlfNeKapMJREAw.md @@ -0,0 +1,31 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') + +## RedisDistributedSynchronizationOptionsBuilder.BusyWaitSleepTime(TimeSpan, TimeSpan) Method + +Waiting to acquire a lock requires a busy wait that alternates acquire attempts and sleeps. +This determines how much time is spent sleeping between attempts. Lower values will raise the +volume of acquire requests under contention but will also raise the responsiveness (how long +it takes a waiter to notice that a contended the lock has become available). + +Specifying a range of values allows the implementation to select an actual value in the range +at random for each sleep. This helps avoid the case where two clients become "synchronized" +in such a way that results in one client monopolizing the lock. + +The default is [10ms, 800ms] + +```csharp +public Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder BusyWaitSleepTime(System.TimeSpan min, System.TimeSpan max); +``` +#### Parameters + + + +`min` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`max` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.Expiry.Aq56pTIqK1xlhiCtghZSyQ.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.Expiry.Aq56pTIqK1xlhiCtghZSyQ.md new file mode 100644 index 00000000..28596fc3 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.Expiry.Aq56pTIqK1xlhiCtghZSyQ.md @@ -0,0 +1,24 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') + +## RedisDistributedSynchronizationOptionsBuilder.Expiry(TimeSpan) Method + +Specifies how long the lock will last, absent auto-extension. Because auto-extension exists, +this value generally will have little effect on program behavior. However, making the expiry longer means that +auto-extension requests can occur less frequently, saving resources. On the other hand, when a lock is abandoned +without explicit release (e. g. if the holding process crashes), the expiry determines how long other processes +would need to wait in order to acquire it. + +Defaults to 30s. + +```csharp +public Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder Expiry(System.TimeSpan expiry); +``` +#### Parameters + + + +`expiry` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.ExtensionCadence.cKv2f155zX3kr5YAmhrxcw.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.ExtensionCadence.cKv2f155zX3kr5YAmhrxcw.md new file mode 100644 index 00000000..5be4e7ff --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.ExtensionCadence.cKv2f155zX3kr5YAmhrxcw.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') + +## RedisDistributedSynchronizationOptionsBuilder.ExtensionCadence(TimeSpan) Method + +Determines how frequently the lock will be extended while held. More frequent extension means more unnecessary requests +but also a lower chance of losing the lock due to the process hanging or otherwise failing to get its extension request in +before the lock expiry elapses. + +Defaults to 1/3 of the specified [MinValidityTime(TimeSpan)](RedisDistributedSynchronizationOptionsBuilder.MinValidityTime.fMaY2fG5om4C0LuUfUZtNg.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder.MinValidityTime(System.TimeSpan)'). + +```csharp +public Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder ExtensionCadence(System.TimeSpan extensionCadence); +``` +#### Parameters + + + +`extensionCadence` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.MinValidityTime.fMaY2fG5om4C0LuUfUZtNg.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.MinValidityTime.fMaY2fG5om4C0LuUfUZtNg.md new file mode 100644 index 00000000..f2e3eb6a --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.MinValidityTime.fMaY2fG5om4C0LuUfUZtNg.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') + +## RedisDistributedSynchronizationOptionsBuilder.MinValidityTime(TimeSpan) Method + +The lock expiry determines how long the lock will be held without being extended. However, since it takes some amount +of time to acquire the lock, we will not have all of expiry available upon acquisition. + +This value sets a minimum amount which we'll be guaranteed to have left once acquisition completes. + +Defaults to 90% of the specified lock expiry. + +```csharp +public Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder MinValidityTime(System.TimeSpan minValidityTime); +``` +#### Parameters + + + +`minValidityTime` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.md new file mode 100644 index 00000000..69fb9388 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationOptionsBuilder.md @@ -0,0 +1,19 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') + +## RedisDistributedSynchronizationOptionsBuilder Class + +Options for configuring a redis-based distributed synchronization algorithm + +```csharp +public sealed class RedisDistributedSynchronizationOptionsBuilder +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 RedisDistributedSynchronizationOptionsBuilder + +| Methods | | +| :--- | :--- | +| [BusyWaitSleepTime(TimeSpan, TimeSpan)](RedisDistributedSynchronizationOptionsBuilder.BusyWaitSleepTime.Z/k+WORQrlfNeKapMJREAw.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder.BusyWaitSleepTime(System.TimeSpan, System.TimeSpan)') | Waiting to acquire a lock requires a busy wait that alternates acquire attempts and sleeps. This determines how much time is spent sleeping between attempts. Lower values will raise the volume of acquire requests under contention but will also raise the responsiveness (how long it takes a waiter to notice that a contended the lock has become available). Specifying a range of values allows the implementation to select an actual value in the range at random for each sleep. This helps avoid the case where two clients become "synchronized" in such a way that results in one client monopolizing the lock. The default is [10ms, 800ms] | +| [Expiry(TimeSpan)](RedisDistributedSynchronizationOptionsBuilder.Expiry.Aq56pTIqK1xlhiCtghZSyQ.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder.Expiry(System.TimeSpan)') | Specifies how long the lock will last, absent auto-extension. Because auto-extension exists, this value generally will have little effect on program behavior. However, making the expiry longer means that auto-extension requests can occur less frequently, saving resources. On the other hand, when a lock is abandoned without explicit release (e. g. if the holding process crashes), the expiry determines how long other processes would need to wait in order to acquire it. Defaults to 30s. | +| [ExtensionCadence(TimeSpan)](RedisDistributedSynchronizationOptionsBuilder.ExtensionCadence.cKv2f155zX3kr5YAmhrxcw.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder.ExtensionCadence(System.TimeSpan)') | Determines how frequently the lock will be extended while held. More frequent extension means more unnecessary requests but also a lower chance of losing the lock due to the process hanging or otherwise failing to get its extension request in before the lock expiry elapses. Defaults to 1/3 of the specified [MinValidityTime(TimeSpan)](RedisDistributedSynchronizationOptionsBuilder.MinValidityTime.fMaY2fG5om4C0LuUfUZtNg.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder.MinValidityTime(System.TimeSpan)'). | +| [MinValidityTime(TimeSpan)](RedisDistributedSynchronizationOptionsBuilder.MinValidityTime.fMaY2fG5om4C0LuUfUZtNg.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder.MinValidityTime(System.TimeSpan)') | The lock expiry determines how long the lock will be held without being extended. However, since it takes some amount of time to acquire the lock, we will not have all of expiry available upon acquisition. This value sets a minimum amount which we'll be guaranteed to have left once acquisition completes. Defaults to 90% of the specified lock expiry. | diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider..ctor.0IYlzCbIJ15NKFmgWswPEg.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider..ctor.0IYlzCbIJ15NKFmgWswPEg.md new file mode 100644 index 00000000..aebed108 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider..ctor.0IYlzCbIJ15NKFmgWswPEg.md @@ -0,0 +1,23 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') + +## RedisDistributedSynchronizationProvider(IEnumerable, Action) Constructor + +Constructs a [RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') that connects to the provided [databases](RedisDistributedSynchronizationProvider..ctor.0IYlzCbIJ15NKFmgWswPEg.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).databases 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable, System.Action).databases') +and uses the provided [options](RedisDistributedSynchronizationProvider..ctor.0IYlzCbIJ15NKFmgWswPEg.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable, System.Action).options'). + +Note that if multiple [StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase')s are provided, [CreateSemaphore(RedisKey, int)](RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey, int)') will use only the first +[StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase'). + +```csharp +public RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable databases, System.Action? options=null); +``` +#### Parameters + + + +`databases` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider..ctor.3LNpdsaHyIM4ZSmOWVrquw.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider..ctor.3LNpdsaHyIM4ZSmOWVrquw.md new file mode 100644 index 00000000..c216e765 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider..ctor.3LNpdsaHyIM4ZSmOWVrquw.md @@ -0,0 +1,20 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') + +## RedisDistributedSynchronizationProvider(IDatabase, Action) Constructor + +Constructs a [RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') that connects to the provided [database](RedisDistributedSynchronizationProvider..ctor.3LNpdsaHyIM4ZSmOWVrquw.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).database 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase, System.Action).database') +and uses the provided [options](RedisDistributedSynchronizationProvider..ctor.3LNpdsaHyIM4ZSmOWVrquw.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase, System.Action).options'). + +```csharp +public RedisDistributedSynchronizationProvider(IDatabase database, System.Action? options=null); +``` +#### Parameters + + + +`database` [StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[RedisDistributedSynchronizationOptionsBuilder](RedisDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateLock.Po1Hx+wws4GErhhVofAcYw.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateLock.Po1Hx+wws4GErhhVofAcYw.md new file mode 100644 index 00000000..67fccb77 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateLock.Po1Hx+wws4GErhhVofAcYw.md @@ -0,0 +1,18 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') + +## RedisDistributedSynchronizationProvider.CreateLock(RedisKey) Method + +Creates a [RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') using the given [key](RedisDistributedSynchronizationProvider.CreateLock.Po1Hx+wws4GErhhVofAcYw.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateLock(RedisKey).key 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateLock(RedisKey).key'). + +```csharp +public Medallion.Threading.Redis.RedisDistributedLock CreateLock(RedisKey key); +``` +#### Parameters + + + +`key` [StackExchange.Redis.RedisKey](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.RedisKey 'StackExchange.Redis.RedisKey') + +#### Returns +[RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateReaderWriterLock.PcVOlZP3alEScwR0NJiftQ.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateReaderWriterLock.PcVOlZP3alEScwR0NJiftQ.md new file mode 100644 index 00000000..d8ef992d --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateReaderWriterLock.PcVOlZP3alEScwR0NJiftQ.md @@ -0,0 +1,20 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') + +## RedisDistributedSynchronizationProvider.CreateReaderWriterLock(string) Method + +Creates a [RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') using the given [name](RedisDistributedSynchronizationProvider.CreateReaderWriterLock.PcVOlZP3alEScwR0NJiftQ.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateReaderWriterLock(string).name 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateReaderWriterLock(string).name'). + +```csharp +public Medallion.Threading.Redis.RedisDistributedReaderWriterLock CreateReaderWriterLock(string name); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +Implements [CreateReaderWriterLock(string)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(System.String)') + +#### Returns +[RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md new file mode 100644 index 00000000..27298f78 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md @@ -0,0 +1,22 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis').[RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') + +## RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey, int) Method + +Creates a [RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') using the provided [key](RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey,int).key 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey, int).key') and [maxCount](RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey,int).maxCount 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey, int).maxCount'). + +```csharp +public Medallion.Threading.Redis.RedisDistributedSemaphore CreateSemaphore(RedisKey key, int maxCount); +``` +#### Parameters + + + +`key` [StackExchange.Redis.RedisKey](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.RedisKey 'StackExchange.Redis.RedisKey') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +#### Returns +[RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') \ No newline at end of file diff --git a/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.md b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.md new file mode 100644 index 00000000..bf8a0e52 --- /dev/null +++ b/docs/api/DistributedLock.Redis/RedisDistributedSynchronizationProvider.md @@ -0,0 +1,30 @@ +#### [DistributedLock.Redis](README.md 'README') +### [Medallion.Threading.Redis](Medallion.Threading.Redis.md 'Medallion.Threading.Redis') + +## RedisDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock'), +[IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') for [RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock'), +and [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') for [RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore'). + +```csharp +public sealed class RedisDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider, +Medallion.Threading.IDistributedReaderWriterLockProvider, +Medallion.Threading.IDistributedSemaphoreProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 RedisDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider'), [IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider'), [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + +| Constructors | | +| :--- | :--- | +| [RedisDistributedSynchronizationProvider(IDatabase, Action<RedisDistributedSynchronizationOptionsBuilder>)](RedisDistributedSynchronizationProvider..ctor.3LNpdsaHyIM4ZSmOWVrquw.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase, System.Action)') | Constructs a [RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') that connects to the provided [database](RedisDistributedSynchronizationProvider..ctor.3LNpdsaHyIM4ZSmOWVrquw.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).database 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase, System.Action).database') and uses the provided [options](RedisDistributedSynchronizationProvider..ctor.3LNpdsaHyIM4ZSmOWVrquw.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(IDatabase, System.Action).options'). | +| [RedisDistributedSynchronizationProvider(IEnumerable<IDatabase>, Action<RedisDistributedSynchronizationOptionsBuilder>)](RedisDistributedSynchronizationProvider..ctor.0IYlzCbIJ15NKFmgWswPEg.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable, System.Action)') | Constructs a [RedisDistributedSynchronizationProvider](RedisDistributedSynchronizationProvider.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider') that connects to the provided [databases](RedisDistributedSynchronizationProvider..ctor.0IYlzCbIJ15NKFmgWswPEg.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).databases 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable, System.Action).databases') and uses the provided [options](RedisDistributedSynchronizationProvider..ctor.0IYlzCbIJ15NKFmgWswPEg.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable_IDatabase_,System.Action_Medallion.Threading.Redis.RedisDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.RedisDistributedSynchronizationProvider(System.Collections.Generic.IEnumerable, System.Action).options'). Note that if multiple [StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase')s are provided, [CreateSemaphore(RedisKey, int)](RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey, int)') will use only the first [StackExchange.Redis.IDatabase](https://docs.microsoft.com/en-us/dotnet/api/StackExchange.Redis.IDatabase 'StackExchange.Redis.IDatabase'). | + +| Methods | | +| :--- | :--- | +| [CreateLock(RedisKey)](RedisDistributedSynchronizationProvider.CreateLock.Po1Hx+wws4GErhhVofAcYw.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateLock(RedisKey)') | Creates a [RedisDistributedLock](RedisDistributedLock.md 'Medallion.Threading.Redis.RedisDistributedLock') using the given [key](RedisDistributedSynchronizationProvider.CreateLock.Po1Hx+wws4GErhhVofAcYw.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateLock(RedisKey).key 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateLock(RedisKey).key'). | +| [CreateReaderWriterLock(string)](RedisDistributedSynchronizationProvider.CreateReaderWriterLock.PcVOlZP3alEScwR0NJiftQ.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateReaderWriterLock(string)') | Creates a [RedisDistributedReaderWriterLock](RedisDistributedReaderWriterLock.md 'Medallion.Threading.Redis.RedisDistributedReaderWriterLock') using the given [name](RedisDistributedSynchronizationProvider.CreateReaderWriterLock.PcVOlZP3alEScwR0NJiftQ.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateReaderWriterLock(string).name 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateReaderWriterLock(string).name'). | +| [CreateSemaphore(RedisKey, int)](RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey, int)') | Creates a [RedisDistributedSemaphore](RedisDistributedSemaphore.md 'Medallion.Threading.Redis.RedisDistributedSemaphore') using the provided [key](RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey,int).key 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey, int).key') and [maxCount](RedisDistributedSynchronizationProvider.CreateSemaphore.ChIw2HaeWq+X0D2xMfTfjg.md#Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey,int).maxCount 'Medallion.Threading.Redis.RedisDistributedSynchronizationProvider.CreateSemaphore(RedisKey, int).maxCount'). | diff --git a/docs/api/DistributedLock.SqlServer/Medallion.Threading.SqlServer.md b/docs/api/DistributedLock.SqlServer/Medallion.Threading.SqlServer.md new file mode 100644 index 00000000..382a2fb7 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/Medallion.Threading.SqlServer.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') + +## Medallion.Threading.SqlServer Namespace + +| Classes | | +| :--- | :--- | +| [SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder') | Specifies options for connecting to and locking against a SQL database | +| [SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') | Implements a distributed lock using a SQL server application lock (see https://msdn.microsoft.com/en-us/library/ms189823.aspx) | +| [SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') | Implements reader-writer lock semantics using a SQL server application lock (see https://msdn.microsoft.com/en-us/library/ms189823.aspx). This class supports the following patterns: * Multiple readers AND single writer (using [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireReadLock.VL35b6pTj/jUeLkzFiukmQ.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') and [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock.FQQa8Ne3Ve3DCYUMPEnBDg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)')) * Multiple readers OR single writer (using [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireReadLock.VL35b6pTj/jUeLkzFiukmQ.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') and [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireWriteLock.EU9XGhm/TaMbin4RU73eiA.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)')) * Upgradeable read locks similar to [System.Threading.ReaderWriterLockSlim.EnterUpgradeableReadLock](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.ReaderWriterLockSlim.EnterUpgradeableReadLock 'System.Threading.ReaderWriterLockSlim.EnterUpgradeableReadLock') (using [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock.FQQa8Ne3Ve3DCYUMPEnBDg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)') and [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)')) | +| [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') | Implements [IDistributedLockUpgradeableHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') | +| [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') | Implements a distributed semaphore using SQL Server constructs. | +| [SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [SqlDistributedSynchronizationProvider](SqlDistributedSynchronizationProvider.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock'), [IDistributedUpgradeableReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') for [SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock'), and [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') for [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore'). | diff --git a/docs/api/DistributedLock.SqlServer/README.md b/docs/api/DistributedLock.SqlServer/README.md new file mode 100644 index 00000000..f309ed5b --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.SqlServer](README.md 'README') + +## DistributedLock.SqlServer Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') | | diff --git a/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.KeepaliveCadence.Y0oyczbLNxA6zX68I22Kzg.md b/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.KeepaliveCadence.Y0oyczbLNxA6zX68I22Kzg.md new file mode 100644 index 00000000..2f0b8540 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.KeepaliveCadence.Y0oyczbLNxA6zX68I22Kzg.md @@ -0,0 +1,28 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder') + +## SqlConnectionOptionsBuilder.KeepaliveCadence(TimeSpan) Method + +Using SQL Azure as a distributed synchronization provider can be challenging due to Azure's aggressive connection governor +which proactively kills idle connections. + +To prevent this, this option sets the cadence at which we run a no-op "keepalive" query on a connection that is holding a lock. +Note that this still does not guarantee protection for the connection from all conditions where the governor might kill it. + +To disable keepalive, set to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan'). + +Defaults to 10 minutes based on Azure's 30 minute default behavior. + +For more information, see the dicussion on https://github.com/madelson/DistributedLock/issues/5 + +```csharp +public Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder KeepaliveCadence(System.TimeSpan keepaliveCadence); +``` +#### Parameters + + + +`keepaliveCadence` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.UseMultiplexing.Bompdy7BJ8LPLMDka9l5hA.md b/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.UseMultiplexing.Bompdy7BJ8LPLMDka9l5hA.md new file mode 100644 index 00000000..afe134ce --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.UseMultiplexing.Bompdy7BJ8LPLMDka9l5hA.md @@ -0,0 +1,31 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder') + +## SqlConnectionOptionsBuilder.UseMultiplexing(bool) Method + +This mode takes advantage of the fact that while "holding" a lock (or other synchronization primitive) +a connection is essentially idle. Thus, rather than creating a new connection for each held lock it is +often possible to multiplex a shared connection so that that connection can hold multiple locks at the same time. + +Multiplexing is on by default. + +This is implemented in such a way that releasing a lock held on such a connection will never be blocked by an +Acquire() call that is waiting to acquire a lock on that same connection. For this reason, the multiplexing +strategy is "optimistic": if the lock can't be acquired instantaneously on the shared connection, a new (shareable) +connection will be allocated. + +This option can improve performance and avoid connection pool starvation in high-load scenarios. It is also +particularly applicable to cases where [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') +semantics are used with a zero-length timeout. + +```csharp +public Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder UseMultiplexing(bool useMultiplexing=true); +``` +#### Parameters + + + +`useMultiplexing` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.UseTransaction.TqcdtREm34ssKiEMMEofaA.md b/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.UseTransaction.TqcdtREm34ssKiEMMEofaA.md new file mode 100644 index 00000000..0096e217 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.UseTransaction.TqcdtREm34ssKiEMMEofaA.md @@ -0,0 +1,23 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder') + +## SqlConnectionOptionsBuilder.UseTransaction(bool) Method + +Whether the synchronization should use a transaction scope rather than a session scope. Defaults to false. + +Synchronizing based on a transaction is marginally less expensive than using a connection +because releasing requires only disposing the underlying [System.Data.IDbTransaction](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction 'System.Data.IDbTransaction'). +The disadvantage is that using this strategy may lead to long-running transactions, which can be +problematic for databases using the full recovery model. + +```csharp +public Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder UseTransaction(bool useTransaction=true); +``` +#### Parameters + + + +`useTransaction` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.md b/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.md new file mode 100644 index 00000000..bd9c6d97 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlConnectionOptionsBuilder.md @@ -0,0 +1,18 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlConnectionOptionsBuilder Class + +Specifies options for connecting to and locking against a SQL database + +```csharp +public sealed class SqlConnectionOptionsBuilder +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 SqlConnectionOptionsBuilder + +| Methods | | +| :--- | :--- | +| [KeepaliveCadence(TimeSpan)](SqlConnectionOptionsBuilder.KeepaliveCadence.Y0oyczbLNxA6zX68I22Kzg.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder.KeepaliveCadence(System.TimeSpan)') | Using SQL Azure as a distributed synchronization provider can be challenging due to Azure's aggressive connection governor which proactively kills idle connections. To prevent this, this option sets the cadence at which we run a no-op "keepalive" query on a connection that is holding a lock. Note that this still does not guarantee protection for the connection from all conditions where the governor might kill it. To disable keepalive, set to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan'). Defaults to 10 minutes based on Azure's 30 minute default behavior. For more information, see the dicussion on https://github.com/madelson/DistributedLock/issues/5 | +| [UseMultiplexing(bool)](SqlConnectionOptionsBuilder.UseMultiplexing.Bompdy7BJ8LPLMDka9l5hA.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder.UseMultiplexing(bool)') | This mode takes advantage of the fact that while "holding" a lock (or other synchronization primitive) a connection is essentially idle. Thus, rather than creating a new connection for each held lock it is often possible to multiplex a shared connection so that that connection can hold multiple locks at the same time. Multiplexing is on by default. This is implemented in such a way that releasing a lock held on such a connection will never be blocked by an Acquire() call that is waiting to acquire a lock on that same connection. For this reason, the multiplexing strategy is "optimistic": if the lock can't be acquired instantaneously on the shared connection, a new (shareable) connection will be allocated. This option can improve performance and avoid connection pool starvation in high-load scenarios. It is also particularly applicable to cases where [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') semantics are used with a zero-length timeout. | +| [UseTransaction(bool)](SqlConnectionOptionsBuilder.UseTransaction.TqcdtREm34ssKiEMMEofaA.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder.UseTransaction(bool)') | Whether the synchronization should use a transaction scope rather than a session scope. Defaults to false. Synchronizing based on a transaction is marginally less expensive than using a connection because releasing requires only disposing the underlying [System.Data.IDbTransaction](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction 'System.Data.IDbTransaction'). The disadvantage is that using this strategy may lead to long-running transactions, which can be problematic for databases using the full recovery model. | diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md new file mode 100644 index 00000000..36aebbea --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md @@ -0,0 +1,31 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') + +## SqlDistributedLock(string, string, Action, bool) Constructor + +Constructs a new lock using the provided [name](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool).name'). + +The provided [connectionString](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool).connectionString') will be used to connect to the database. + +Unless [exactName](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool).exactName') is specified, [name](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public SqlDistributedLock(string name, string connectionString, System.Action? options=null, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md new file mode 100644 index 00000000..ba04edac --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md @@ -0,0 +1,28 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') + +## SqlDistributedLock(string, IDbConnection, bool) Constructor + +Constructs a new lock using the provided [name](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool).name'). + +The provided [connection](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool).connection') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and +will not be opened or closed. + +Unless [exactName](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public SqlDistributedLock(string name, System.Data.IDbConnection connection, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md new file mode 100644 index 00000000..3f28cced --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md @@ -0,0 +1,28 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') + +## SqlDistributedLock(string, IDbTransaction, bool) Constructor + +Constructs a new lock using the provided [name](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool).name'). + +The provided [transaction](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbTransaction,bool).transaction 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool).transaction') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and +will not be committed or rolled back. + +Unless [exactName](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbTransaction,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool).exactName') is specified, [name](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public SqlDistributedLock(string name, System.Data.IDbTransaction transaction, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`transaction` [System.Data.IDbTransaction](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction 'System.Data.IDbTransaction') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock.Acquire.zbspE3pGxl+PD2ikaBjjHQ.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.Acquire.zbspE3pGxl+PD2ikaBjjHQ.md new file mode 100644 index 00000000..5d7eab8c --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.Acquire.zbspE3pGxl+PD2ikaBjjHQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') + +## SqlDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedLockHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') +A [SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock.AcquireAsync.H4cG/yzFNt8CX+DvrGY7Ew.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.AcquireAsync.H4cG/yzFNt8CX+DvrGY7Ew.md new file mode 100644 index 00000000..1810c62c --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.AcquireAsync.H4cG/yzFNt8CX+DvrGY7Ew.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') + +## SqlDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock.Name.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.Name.md new file mode 100644 index 00000000..9943f3e9 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') + +## SqlDistributedLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock.TryAcquire.+75ri4YlUSx+YHiFkRqGYA.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.TryAcquire.+75ri4YlUSx+YHiFkRqGYA.md new file mode 100644 index 00000000..6f167f98 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.TryAcquire.+75ri4YlUSx+YHiFkRqGYA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') + +## SqlDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedLockHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') +A [SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock.TryAcquireAsync.uIPf8DVSTmuiby/hHjaF2Q.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.TryAcquireAsync.uIPf8DVSTmuiby/hHjaF2Q.md new file mode 100644 index 00000000..d2c07cb6 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.TryAcquireAsync.uIPf8DVSTmuiby/hHjaF2Q.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') + +## SqlDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLock.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.md new file mode 100644 index 00000000..eecbcb29 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLock.md @@ -0,0 +1,33 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlDistributedLock Class + +Implements a distributed lock using a SQL server application lock +(see https://msdn.microsoft.com/en-us/library/ms189823.aspx) + +```csharp +public sealed class SqlDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 SqlDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [SqlDistributedLock(string, string, Action<SqlConnectionOptionsBuilder>, bool)](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool)') | Constructs a new lock using the provided [name](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool).name'). The provided [connectionString](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool).connectionString') will be used to connect to the database. Unless [exactName](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool).exactName') is specified, [name](SqlDistributedLock..ctor.IXLn8ksHwo3nLgCG5b0COA.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. | +| [SqlDistributedLock(string, IDbConnection, bool)](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool)') | Constructs a new lock using the provided [name](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool).name'). The provided [connection](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool).connection') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and will not be opened or closed. Unless [exactName](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](SqlDistributedLock..ctor.OZ2lCJsURZ+h8HKzPvymjw.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. | +| [SqlDistributedLock(string, IDbTransaction, bool)](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool)') | Constructs a new lock using the provided [name](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool).name'). The provided [transaction](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbTransaction,bool).transaction 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool).transaction') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and will not be committed or rolled back. Unless [exactName](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbTransaction,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool).exactName') is specified, [name](SqlDistributedLock..ctor.fV1bw9iga5pQQYPMV/GL1w.md#Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.SqlServer.SqlDistributedLock.SqlDistributedLock(string, System.Data.IDbTransaction, bool).name') will be escaped/hashed to ensure name validity. | + +| Properties | | +| :--- | :--- | +| [Name](SqlDistributedLock.Name.md 'Medallion.Threading.SqlServer.SqlDistributedLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](SqlDistributedLock.Acquire.zbspE3pGxl+PD2ikaBjjHQ.md 'Medallion.Threading.SqlServer.SqlDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](SqlDistributedLock.AcquireAsync.H4cG/yzFNt8CX+DvrGY7Ew.md 'Medallion.Threading.SqlServer.SqlDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](SqlDistributedLock.TryAcquire.+75ri4YlUSx+YHiFkRqGYA.md 'Medallion.Threading.SqlServer.SqlDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](SqlDistributedLock.TryAcquireAsync.uIPf8DVSTmuiby/hHjaF2Q.md 'Medallion.Threading.SqlServer.SqlDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.Dispose().md b/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.Dispose().md new file mode 100644 index 00000000..5dc15f62 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') + +## SqlDistributedLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..47e7943a --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') + +## SqlDistributedLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.HandleLostToken.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.HandleLostToken.md new file mode 100644 index 00000000..fd8f1775 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedLockHandle](SqlDistributedLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle') + +## SqlDistributedLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.md b/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.md new file mode 100644 index 00000000..13fa0be0 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedLockHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class SqlDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 SqlDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](SqlDistributedLockHandle.HandleLostToken.md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](SqlDistributedLockHandle.Dispose().md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](SqlDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.SqlServer.SqlDistributedLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md new file mode 100644 index 00000000..f3ed8d1f --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md @@ -0,0 +1,28 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock(string, IDbTransaction, bool) Constructor + +Constructs a new lock using the provided [name](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool).name'). + +The provided [transaction](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbTransaction,bool).transaction 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool).transaction') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and +will not be committed or rolled back. + +Unless [exactName](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbTransaction,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool).exactName') is specified, [name](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public SqlDistributedReaderWriterLock(string name, System.Data.IDbTransaction transaction, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`transaction` [System.Data.IDbTransaction](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction 'System.Data.IDbTransaction') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md new file mode 100644 index 00000000..9bc92132 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md @@ -0,0 +1,28 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock(string, IDbConnection, bool) Constructor + +Constructs a new lock using the provided [name](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).name'). + +The provided [connection](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).connection') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and +will not be opened or closed. + +Unless [exactName](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public SqlDistributedReaderWriterLock(string name, System.Data.IDbConnection connection, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md new file mode 100644 index 00000000..7e4bfef1 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md @@ -0,0 +1,31 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock(string, string, Action, bool) Constructor + +Constructs a new lock using the provided [name](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool).name'). + +The provided [connectionString](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool).connectionString') will be used to connect to the database. + +Unless [exactName](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool).exactName') is specified, [name](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public SqlDistributedReaderWriterLock(string name, string connectionString, System.Action? options=null, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireReadLock.VL35b6pTj/jUeLkzFiukmQ.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireReadLock.VL35b6pTj/jUeLkzFiukmQ.md new file mode 100644 index 00000000..f51f09b1 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireReadLock.VL35b6pTj/jUeLkzFiukmQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.AcquireReadLock(Nullable, CancellationToken) Method + +Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (myLock.AcquireReadLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle AcquireReadLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLock.bAhgltfPpI+hi4bNotiyGg.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') +A [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireReadLockAsync.frJQMqQ08BVx5q1tgkQxjQ.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireReadLockAsync.frJQMqQ08BVx5q1tgkQxjQ.md new file mode 100644 index 00000000..18e86815 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireReadLockAsync.frJQMqQ08BVx5q1tgkQxjQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.AcquireReadLockAsync(Nullable, CancellationToken) Method + +Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock.FQQa8Ne3Ve3DCYUMPEnBDg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock.FQQa8Ne3Ve3DCYUMPEnBDg.md new file mode 100644 index 00000000..a8cb0aff --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock.FQQa8Ne3Ve3DCYUMPEnBDg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock(Nullable, CancellationToken) Method + +Acquires an UPGRADE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +using (myLock.AcquireUpgradeableReadLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle AcquireUpgradeableReadLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock.MgsbqNeNv0qen0RVQV8MHA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') +A [SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync.m/YUdo7XWAgnG1T4s0f5Vw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync.m/YUdo7XWAgnG1T4s0f5Vw.md new file mode 100644 index 00000000..451abb95 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync.m/YUdo7XWAgnG1T4s0f5Vw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync(Nullable, CancellationToken) Method + +Acquires an UPGRADE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireUpgradeableReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireUpgradeableReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireUpgradeableReadLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync.XDD/LbfIJrScMNU14D5OvA.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.AcquireUpgradeableReadLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireWriteLock.EU9XGhm/TaMbin4RU73eiA.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireWriteLock.EU9XGhm/TaMbin4RU73eiA.md new file mode 100644 index 00000000..0d677176 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireWriteLock.EU9XGhm/TaMbin4RU73eiA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.AcquireWriteLock(Nullable, CancellationToken) Method + +Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (myLock.AcquireWriteLock(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle AcquireWriteLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLock.8zDirrYDrgr0WzrsnH7blA.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') +A [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireWriteLockAsync.am3WXoiXExWu7PDcFrcbHg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireWriteLockAsync.am3WXoiXExWu7PDcFrcbHg.md new file mode 100644 index 00000000..3a9cef77 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.AcquireWriteLockAsync.am3WXoiXExWu7PDcFrcbHg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.AcquireWriteLockAsync(Nullable, CancellationToken) Method + +Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (await myLock.AcquireWriteLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.Name.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.Name.md new file mode 100644 index 00000000..6345e705 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireReadLock.UqHJCSMD9c66tSl6eX0L5w.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireReadLock.UqHJCSMD9c66tSl6eX0L5w.md new file mode 100644 index 00000000..511f1bc0 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireReadLock.UqHJCSMD9c66tSl6eX0L5w.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.TryAcquireReadLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireReadLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle? TryAcquireReadLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLock.FwhFBAUmx9brWLKd6O1SSw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') +A [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireReadLockAsync.sG3MIB9MAtPJdHFbnV2eSw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireReadLockAsync.sG3MIB9MAtPJdHFbnV2eSw.md new file mode 100644 index 00000000..48ef23c1 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireReadLockAsync.sG3MIB9MAtPJdHFbnV2eSw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.TryAcquireReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLock.+0DGM6PoyEWIi1vW2vuGTg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLock.+0DGM6PoyEWIi1vW2vuGTg.md new file mode 100644 index 00000000..d5c2ec5a --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLock.+0DGM6PoyEWIi1vW2vuGTg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken) Method + +Attempts to acquire an UPGRADE lock synchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireUpgradeableReadLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle? TryAcquireUpgradeableReadLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock.NcomTiK4v4VsrD5p8zrY6A.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') +A [SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync.cFH9Wic6iC3c0NhaQB0+3A.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync.cFH9Wic6iC3c0NhaQB0+3A.md new file mode 100644 index 00000000..f6e77031 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync.cFH9Wic6iC3c0NhaQB0+3A.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire an UPGRADE lock asynchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireUpgradeableReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireUpgradeableReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync.NeQQ4jMkCO0IteXQSJv/1w.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock.TryAcquireUpgradeableReadLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireWriteLock.ZWd9ONo8vWJyVmWMPBHRtg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireWriteLock.ZWd9ONo8vWJyVmWMPBHRtg.md new file mode 100644 index 00000000..06785ebb --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireWriteLock.ZWd9ONo8vWJyVmWMPBHRtg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.TryAcquireWriteLock(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +using (var handle = myLock.TryAcquireWriteLock(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle? TryAcquireWriteLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLock.ypAYPzEP3B1U6LcOEQzWBw.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') +A [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireWriteLockAsync.PXBAXD3VfrmbmNfR4TNxfg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireWriteLockAsync.PXBAXD3VfrmbmNfR4TNxfg.md new file mode 100644 index 00000000..b5b15cb4 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.TryAcquireWriteLockAsync.PXBAXD3VfrmbmNfR4TNxfg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') + +## SqlDistributedReaderWriterLock.TryAcquireWriteLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireWriteLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.md new file mode 100644 index 00000000..0d859d77 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLock.md @@ -0,0 +1,47 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlDistributedReaderWriterLock Class + +Implements reader-writer lock semantics using a SQL server application lock +(see https://msdn.microsoft.com/en-us/library/ms189823.aspx). + +This class supports the following patterns: +* Multiple readers AND single writer (using [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireReadLock.VL35b6pTj/jUeLkzFiukmQ.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') and [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock.FQQa8Ne3Ve3DCYUMPEnBDg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)')) +* Multiple readers OR single writer (using [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireReadLock.VL35b6pTj/jUeLkzFiukmQ.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') and [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireWriteLock.EU9XGhm/TaMbin4RU73eiA.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)')) +* Upgradeable read locks similar to [System.Threading.ReaderWriterLockSlim.EnterUpgradeableReadLock](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.ReaderWriterLockSlim.EnterUpgradeableReadLock 'System.Threading.ReaderWriterLockSlim.EnterUpgradeableReadLock') (using [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock.FQQa8Ne3Ve3DCYUMPEnBDg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)') and [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)')) + +```csharp +public sealed class SqlDistributedReaderWriterLock : +Medallion.Threading.IDistributedUpgradeableReaderWriterLock, +Medallion.Threading.IDistributedReaderWriterLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 SqlDistributedReaderWriterLock + +Implements [IDistributedUpgradeableReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLock.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLock'), [IDistributedReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +| Constructors | | +| :--- | :--- | +| [SqlDistributedReaderWriterLock(string, string, Action<SqlConnectionOptionsBuilder>, bool)](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool)') | Constructs a new lock using the provided [name](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool).name'). The provided [connectionString](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).connectionString 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool).connectionString') will be used to connect to the database. Unless [exactName](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool).exactName') is specified, [name](SqlDistributedReaderWriterLock..ctor.t7dQ4a6u8pWRU7S46Bev2w.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, string, System.Action, bool).name') will be escaped/hashed to ensure name validity. | +| [SqlDistributedReaderWriterLock(string, IDbConnection, bool)](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool)') | Constructs a new lock using the provided [name](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).name'). The provided [connection](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).connection 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).connection') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and will not be opened or closed. Unless [exactName](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).exactName') is specified, [name](SqlDistributedReaderWriterLock..ctor.aQ4wmiPxon1R/D2jE25+dg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbConnection,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbConnection, bool).name') will be escaped/hashed to ensure name validity. | +| [SqlDistributedReaderWriterLock(string, IDbTransaction, bool)](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool)') | Constructs a new lock using the provided [name](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool).name'). The provided [transaction](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbTransaction,bool).transaction 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool).transaction') will be used to connect to the database and will provide lock scope. It is assumed to be externally managed and will not be committed or rolled back. Unless [exactName](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbTransaction,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool).exactName') is specified, [name](SqlDistributedReaderWriterLock..ctor.V/fj2Yk0d/CnC3hDs1y3Cg.md#Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string,System.Data.IDbTransaction,bool).name 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.SqlDistributedReaderWriterLock(string, System.Data.IDbTransaction, bool).name') will be escaped/hashed to ensure name validity. | + +| Properties | | +| :--- | :--- | +| [Name](SqlDistributedReaderWriterLock.Name.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [AcquireReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireReadLock.VL35b6pTj/jUeLkzFiukmQ.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireReadLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireReadLockAsync.frJQMqQ08BVx5q1tgkQxjQ.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireUpgradeableReadLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock.FQQa8Ne3Ve3DCYUMPEnBDg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireUpgradeableReadLock(System.Nullable, System.Threading.CancellationToken)') | Acquires an UPGRADE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [AcquireUpgradeableReadLockAsync(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync.m/YUdo7XWAgnG1T4s0f5Vw.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireUpgradeableReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires an UPGRADE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [AcquireWriteLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireWriteLock.EU9XGhm/TaMbin4RU73eiA.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireWriteLock(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLock.AcquireWriteLockAsync.am3WXoiXExWu7PDcFrcbHg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireReadLock(TimeSpan, CancellationToken)](SqlDistributedReaderWriterLock.TryAcquireReadLock.UqHJCSMD9c66tSl6eX0L5w.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.TryAcquireReadLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock synchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](SqlDistributedReaderWriterLock.TryAcquireReadLockAsync.sG3MIB9MAtPJdHFbnV2eSw.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireUpgradeableReadLock(TimeSpan, CancellationToken)](SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLock.+0DGM6PoyEWIi1vW2vuGTg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire an UPGRADE lock synchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [TryAcquireUpgradeableReadLockAsync(TimeSpan, CancellationToken)](SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync.cFH9Wic6iC3c0NhaQB0+3A.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.TryAcquireUpgradeableReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire an UPGRADE lock asynchronously. Not compatible with another UPGRADE lock or a WRITE lock. Usage: | +| [TryAcquireWriteLock(TimeSpan, CancellationToken)](SqlDistributedReaderWriterLock.TryAcquireWriteLock.ZWd9ONo8vWJyVmWMPBHRtg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.TryAcquireWriteLock(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock synchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](SqlDistributedReaderWriterLock.TryAcquireWriteLockAsync.PXBAXD3VfrmbmNfR4TNxfg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.Dispose().md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.Dispose().md new file mode 100644 index 00000000..dd30347e --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') + +## SqlDistributedReaderWriterLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.DisposeAsync().md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.DisposeAsync().md new file mode 100644 index 00000000..86773d00 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') + +## SqlDistributedReaderWriterLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public abstract System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.HandleLostToken.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.HandleLostToken.md new file mode 100644 index 00000000..78d21b2c --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') + +## SqlDistributedReaderWriterLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public abstract System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.md new file mode 100644 index 00000000..b17827f8 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockHandle.md @@ -0,0 +1,29 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlDistributedReaderWriterLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public abstract class SqlDistributedReaderWriterLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 SqlDistributedReaderWriterLockHandle + +Derived +↳ [SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](SqlDistributedReaderWriterLockHandle.HandleLostToken.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](SqlDistributedReaderWriterLockHandle.Dispose().md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](SqlDistributedReaderWriterLockHandle.DisposeAsync().md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.DisposeAsync().md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.DisposeAsync().md new file mode 100644 index 00000000..bfd76279 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') + +## SqlDistributedReaderWriterLockUpgradeableHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public override System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.HandleLostToken.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.HandleLostToken.md new file mode 100644 index 00000000..0d1cc85c --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') + +## SqlDistributedReaderWriterLockUpgradeableHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public override System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock.zMUOGQVaJkWs3VcJXp+UCw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock.zMUOGQVaJkWs3VcJXp+UCw.md new file mode 100644 index 00000000..c406b858 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock.zMUOGQVaJkWs3VcJXp+UCw.md @@ -0,0 +1,24 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') + +## SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock(TimeSpan, CancellationToken) Method + +Implements [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan,System.Threading.CancellationToken)') + +```csharp +public bool TryUpgradeToWriteLock(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Implements [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync.8oq6BCJTyac4Rk/328XUBw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync.8oq6BCJTyac4Rk/328XUBw.md new file mode 100644 index 00000000..9fa065dd --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync.8oq6BCJTyac4Rk/328XUBw.md @@ -0,0 +1,24 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') + +## SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken) Method + +Implements [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +```csharp +public System.Threading.Tasks.ValueTask TryUpgradeToWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Implements [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock.jbRB6OR/9hXGBo4CJ+m0bw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock.jbRB6OR/9hXGBo4CJ+m0bw.md new file mode 100644 index 00000000..1dca2247 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock.jbRB6OR/9hXGBo4CJ+m0bw.md @@ -0,0 +1,21 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') + +## SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock(Nullable, CancellationToken) Method + +Implements [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +```csharp +public void UpgradeToWriteLock(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Implements [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync.Vi+8+okgqbatuvWRASkevg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync.Vi+8+okgqbatuvWRASkevg.md new file mode 100644 index 00000000..be589658 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync.Vi+8+okgqbatuvWRASkevg.md @@ -0,0 +1,24 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedReaderWriterLockUpgradeableHandle](SqlDistributedReaderWriterLockUpgradeableHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle') + +## SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync(Nullable, CancellationToken) Method + +Implements [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +```csharp +public System.Threading.Tasks.ValueTask UpgradeToWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Implements [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.md b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.md new file mode 100644 index 00000000..a2691bcf --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedReaderWriterLockUpgradeableHandle.md @@ -0,0 +1,30 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlDistributedReaderWriterLockUpgradeableHandle Class + +Implements [IDistributedLockUpgradeableHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle') + +```csharp +public sealed class SqlDistributedReaderWriterLockUpgradeableHandle : Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle, +Medallion.Threading.IDistributedLockUpgradeableHandle, +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 [SqlDistributedReaderWriterLockHandle](SqlDistributedReaderWriterLockHandle.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockHandle') 🡒 SqlDistributedReaderWriterLockUpgradeableHandle + +Implements [IDistributedLockUpgradeableHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.md 'Medallion.Threading.IDistributedLockUpgradeableHandle'), [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](SqlDistributedReaderWriterLockUpgradeableHandle.HandleLostToken.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [DisposeAsync()](SqlDistributedReaderWriterLockUpgradeableHandle.DisposeAsync().md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle.DisposeAsync()') | Releases the lock asynchronously | +| [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock.zMUOGQVaJkWs3VcJXp+UCw.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan, System.Threading.CancellationToken)') | Implements [TryUpgradeToWriteLock(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock.kj/tM1emIKPQTMhyxJaEVg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLock(System.TimeSpan,System.Threading.CancellationToken)') | +| [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync.8oq6BCJTyac4Rk/328XUBw.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Implements [TryUpgradeToWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync.wN/ZfUBdRwlMtX9ctB9dtg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.TryUpgradeToWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') | +| [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock.jbRB6OR/9hXGBo4CJ+m0bw.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable, System.Threading.CancellationToken)') | Implements [UpgradeToWriteLock(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLock.Tz7MsKLra+HymbjqGwuzRQ.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLock(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') | +| [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync.Vi+8+okgqbatuvWRASkevg.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Implements [UpgradeToWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync.5X2Faf/VtyA3b0uF1JN1kg.md 'Medallion.Threading.IDistributedLockUpgradeableHandle.UpgradeToWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') | diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md new file mode 100644 index 00000000..174289b6 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md @@ -0,0 +1,26 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore(string, int, IDbConnection) Constructor + +Creates a semaphore with name [name](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbConnection).name 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection).name') that can be acquired up to [maxCount](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbConnection).maxCount 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection).maxCount') +times concurrently. When acquired, the semaphore will be scoped to the given [connection](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbConnection).connection 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection).connection'). +The [connection](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbConnection).connection 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection).connection') is assumed to be externally managed: the [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') will +not attempt to open, close, or dispose it + +```csharp +public SqlDistributedSemaphore(string name, int maxCount, System.Data.IDbConnection connection); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md new file mode 100644 index 00000000..013ee430 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md @@ -0,0 +1,26 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore(string, int, IDbTransaction) Constructor + +Creates a semaphore with name [name](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbTransaction).name 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction).name') that can be acquired up to [maxCount](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbTransaction).maxCount 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction).maxCount') +times concurrently. When acquired, the semaphore will be scoped to the given [transaction](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbTransaction).transaction 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction).transaction'). +The [transaction](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbTransaction).transaction 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction).transaction') and its [System.Data.IDbTransaction.Connection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction.Connection 'System.Data.IDbTransaction.Connection') are assumed to be externally managed: +the [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') will not attempt to open, close, commit, roll back, or dispose them + +```csharp +public SqlDistributedSemaphore(string name, int maxCount, System.Data.IDbTransaction transaction); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`transaction` [System.Data.IDbTransaction](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction 'System.Data.IDbTransaction') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md new file mode 100644 index 00000000..05b9f661 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md @@ -0,0 +1,28 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore(string, int, string, Action) Constructor + +Creates a semaphore with name [name](SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).name 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, string, System.Action).name') that can be acquired up to [maxCount](SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).maxCount 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, string, System.Action).maxCount') +times concurrently. The provided [connectionString](SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).connectionString 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, string, System.Action).connectionString') will be used to connect to the database. + +```csharp +public SqlDistributedSemaphore(string name, int maxCount, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.Acquire.4HnR2Q10n/AB5PR0OVZDpw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.Acquire.4HnR2Q10n/AB5PR0OVZDpw.md new file mode 100644 index 00000000..93ade7a9 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.Acquire.4HnR2Q10n/AB5PR0OVZDpw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore.Acquire(Nullable, CancellationToken) Method + +Acquires a semaphore ticket synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (mySemaphore.Acquire(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md 'Medallion.Threading.IDistributedSemaphore.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') +A [SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.AcquireAsync.0jaVdGSo+de/zoZcbd0xQw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.AcquireAsync.0jaVdGSo+de/zoZcbd0xQw.md new file mode 100644 index 00000000..b6b7c6b5 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.AcquireAsync.0jaVdGSo+de/zoZcbd0xQw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore.AcquireAsync(Nullable, CancellationToken) Method + +Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await mySemaphore.AcquireAsync(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md 'Medallion.Threading.IDistributedSemaphore.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.MaxCount.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.MaxCount.md new file mode 100644 index 00000000..a8be4457 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.MaxCount.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore.MaxCount Property + +Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') + +```csharp +public int MaxCount { get; } +``` + +Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.Name.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.Name.md new file mode 100644 index 00000000..d5a1fca4 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.TryAcquire.3L6fL8XbcwjI2MLrAh55tw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.TryAcquire.3L6fL8XbcwjI2MLrAh55tw.md new file mode 100644 index 00000000..4dbbbe60 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.TryAcquire.3L6fL8XbcwjI2MLrAh55tw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket synchronously. Usage: + +```csharp +using (var handle = mySemaphore.TryAcquire(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md 'Medallion.Threading.IDistributedSemaphore.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') +A [SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.TryAcquireAsync.IRSRwL6SUQA/rW6ewYOdNw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.TryAcquireAsync.IRSRwL6SUQA/rW6ewYOdNw.md new file mode 100644 index 00000000..fa8b1c04 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.TryAcquireAsync.IRSRwL6SUQA/rW6ewYOdNw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') + +## SqlDistributedSemaphore.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket asynchronously. Usage: + +```csharp +await using (var handle = await mySemaphore.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md 'Medallion.Threading.IDistributedSemaphore.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.md new file mode 100644 index 00000000..a227c7d4 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphore.md @@ -0,0 +1,33 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlDistributedSemaphore Class + +Implements a distributed semaphore using SQL Server constructs. + +```csharp +public sealed class SqlDistributedSemaphore : +Medallion.Threading.IDistributedSemaphore +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 SqlDistributedSemaphore + +Implements [IDistributedSemaphore](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +| Constructors | | +| :--- | :--- | +| [SqlDistributedSemaphore(string, int, string, Action<SqlConnectionOptionsBuilder>)](SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, string, System.Action)') | Creates a semaphore with name [name](SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).name 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, string, System.Action).name') that can be acquired up to [maxCount](SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).maxCount 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, string, System.Action).maxCount') times concurrently. The provided [connectionString](SqlDistributedSemaphore..ctor.s6/ahDpIg3est068m3+NgA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).connectionString 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, string, System.Action).connectionString') will be used to connect to the database. | +| [SqlDistributedSemaphore(string, int, IDbConnection)](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection)') | Creates a semaphore with name [name](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbConnection).name 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection).name') that can be acquired up to [maxCount](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbConnection).maxCount 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection).maxCount') times concurrently. When acquired, the semaphore will be scoped to the given [connection](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbConnection).connection 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection).connection'). The [connection](SqlDistributedSemaphore..ctor.BXWZBo51Xli5HcVudj4PPQ.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbConnection).connection 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbConnection).connection') is assumed to be externally managed: the [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') will not attempt to open, close, or dispose it | +| [SqlDistributedSemaphore(string, int, IDbTransaction)](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction)') | Creates a semaphore with name [name](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbTransaction).name 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction).name') that can be acquired up to [maxCount](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbTransaction).maxCount 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction).maxCount') times concurrently. When acquired, the semaphore will be scoped to the given [transaction](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbTransaction).transaction 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction).transaction'). The [transaction](SqlDistributedSemaphore..ctor.h/TmHEv8QIhpjqtxBSqudA.md#Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string,int,System.Data.IDbTransaction).transaction 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.SqlDistributedSemaphore(string, int, System.Data.IDbTransaction).transaction') and its [System.Data.IDbTransaction.Connection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction.Connection 'System.Data.IDbTransaction.Connection') are assumed to be externally managed: the [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') will not attempt to open, close, commit, roll back, or dispose them | + +| Properties | | +| :--- | :--- | +| [MaxCount](SqlDistributedSemaphore.MaxCount.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.MaxCount') | Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') | +| [Name](SqlDistributedSemaphore.Name.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](SqlDistributedSemaphore.Acquire.4HnR2Q10n/AB5PR0OVZDpw.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](SqlDistributedSemaphore.AcquireAsync.0jaVdGSo+de/zoZcbd0xQw.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](SqlDistributedSemaphore.TryAcquire.3L6fL8XbcwjI2MLrAh55tw.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](SqlDistributedSemaphore.TryAcquireAsync.IRSRwL6SUQA/rW6ewYOdNw.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket asynchronously. Usage: | diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.Dispose().md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.Dispose().md new file mode 100644 index 00000000..cd833a5a --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') + +## SqlDistributedSemaphoreHandle.Dispose() Method + +Releases the semaphore + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.DisposeAsync().md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.DisposeAsync().md new file mode 100644 index 00000000..48310c1a --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') + +## SqlDistributedSemaphoreHandle.DisposeAsync() Method + +Releases the semaphore asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.HandleLostToken.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.HandleLostToken.md new file mode 100644 index 00000000..2edaca34 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSemaphoreHandle](SqlDistributedSemaphoreHandle.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle') + +## SqlDistributedSemaphoreHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.md new file mode 100644 index 00000000..bdfe0067 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSemaphoreHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlDistributedSemaphoreHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class SqlDistributedSemaphoreHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 SqlDistributedSemaphoreHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](SqlDistributedSemaphoreHandle.HandleLostToken.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](SqlDistributedSemaphoreHandle.Dispose().md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle.Dispose()') | Releases the semaphore | +| [DisposeAsync()](SqlDistributedSemaphoreHandle.DisposeAsync().md 'Medallion.Threading.SqlServer.SqlDistributedSemaphoreHandle.DisposeAsync()') | Releases the semaphore asynchronously | diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.QbNGXebcf9bdcSs15AJxAg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.QbNGXebcf9bdcSs15AJxAg.md new file mode 100644 index 00000000..36b52829 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.QbNGXebcf9bdcSs15AJxAg.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSynchronizationProvider](SqlDistributedSynchronizationProvider.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider') + +## SqlDistributedSynchronizationProvider(IDbTransaction) Constructor + +Constructs a provider that connects with [transaction](SqlDistributedSynchronizationProvider..ctor.QbNGXebcf9bdcSs15AJxAg.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbTransaction).transaction 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbTransaction).transaction'). + +```csharp +public SqlDistributedSynchronizationProvider(System.Data.IDbTransaction transaction); +``` +#### Parameters + + + +`transaction` [System.Data.IDbTransaction](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbTransaction 'System.Data.IDbTransaction') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.uXiGZXEHL3VIEtbm7sJCDw.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.uXiGZXEHL3VIEtbm7sJCDw.md new file mode 100644 index 00000000..78a3e5c3 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.uXiGZXEHL3VIEtbm7sJCDw.md @@ -0,0 +1,19 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSynchronizationProvider](SqlDistributedSynchronizationProvider.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider') + +## SqlDistributedSynchronizationProvider(string, Action) Constructor + +Constructs a provider that connects with [connectionString](SqlDistributedSynchronizationProvider..ctor.uXiGZXEHL3VIEtbm7sJCDw.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).connectionString 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](SqlDistributedSynchronizationProvider..ctor.uXiGZXEHL3VIEtbm7sJCDw.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).options 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string, System.Action).options'). + +```csharp +public SqlDistributedSynchronizationProvider(string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[SqlConnectionOptionsBuilder](SqlConnectionOptionsBuilder.md 'Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.wIWVEFdYGHcqScaVWCtaYg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.wIWVEFdYGHcqScaVWCtaYg.md new file mode 100644 index 00000000..474f16ac --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider..ctor.wIWVEFdYGHcqScaVWCtaYg.md @@ -0,0 +1,15 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSynchronizationProvider](SqlDistributedSynchronizationProvider.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider') + +## SqlDistributedSynchronizationProvider(IDbConnection) Constructor + +Constructs a provider that connects with [connection](SqlDistributedSynchronizationProvider..ctor.wIWVEFdYGHcqScaVWCtaYg.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbConnection).connection 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbConnection).connection'). + +```csharp +public SqlDistributedSynchronizationProvider(System.Data.IDbConnection connection); +``` +#### Parameters + + + +`connection` [System.Data.IDbConnection](https://docs.microsoft.com/en-us/dotnet/api/System.Data.IDbConnection 'System.Data.IDbConnection') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateLock.OBB/tAHXb7DSNADefkuRKg.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateLock.OBB/tAHXb7DSNADefkuRKg.md new file mode 100644 index 00000000..beedc4ce --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateLock.OBB/tAHXb7DSNADefkuRKg.md @@ -0,0 +1,23 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSynchronizationProvider](SqlDistributedSynchronizationProvider.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider') + +## SqlDistributedSynchronizationProvider.CreateLock(string, bool) Method + +Constructs an instance of [SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') with the provided [name](SqlDistributedSynchronizationProvider.CreateLock.OBB/tAHXb7DSNADefkuRKg.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string,bool).name 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string, bool).name'). Unless [exactName](SqlDistributedSynchronizationProvider.CreateLock.OBB/tAHXb7DSNADefkuRKg.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string, bool).exactName') +is specified, invalid applock names will be escaped/hashed. + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedLock CreateLock(string name, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateReaderWriterLock/sU0nmoSgVAlSEihYgHv9Q.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateReaderWriterLock/sU0nmoSgVAlSEihYgHv9Q.md new file mode 100644 index 00000000..2d5f5a6e --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateReaderWriterLock/sU0nmoSgVAlSEihYgHv9Q.md @@ -0,0 +1,23 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSynchronizationProvider](SqlDistributedSynchronizationProvider.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider') + +## SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool) Method + +Constructs an instance of [SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') with the provided [name](SqlDistributedSynchronizationProvider.CreateReaderWriterLock./sU0nmoSgVAlSEihYgHv9Q.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string,bool).name 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool).name'). Unless [exactName](SqlDistributedSynchronizationProvider.CreateReaderWriterLock./sU0nmoSgVAlSEihYgHv9Q.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool).exactName') +is specified, invalid applock names will be escaped/hashed. + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock CreateReaderWriterLock(string name, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateSemaphore.NU06amMuOL4wYpDoFLZ7sA.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateSemaphore.NU06amMuOL4wYpDoFLZ7sA.md new file mode 100644 index 00000000..1c0456fc --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.CreateSemaphore.NU06amMuOL4wYpDoFLZ7sA.md @@ -0,0 +1,24 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer').[SqlDistributedSynchronizationProvider](SqlDistributedSynchronizationProvider.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider') + +## SqlDistributedSynchronizationProvider.CreateSemaphore(string, int) Method + +Constructs an instance of [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') with the provided [name](SqlDistributedSynchronizationProvider.CreateSemaphore.NU06amMuOL4wYpDoFLZ7sA.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string,int).name 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string, int).name') and [maxCount](SqlDistributedSynchronizationProvider.CreateSemaphore.NU06amMuOL4wYpDoFLZ7sA.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string,int).maxCount 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string, int).maxCount'). + +```csharp +public Medallion.Threading.SqlServer.SqlDistributedSemaphore CreateSemaphore(string name, int maxCount); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +Implements [CreateSemaphore(string, int)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(System.String,System.Int32)') + +#### Returns +[SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') \ No newline at end of file diff --git a/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.md b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.md new file mode 100644 index 00000000..6de15734 --- /dev/null +++ b/docs/api/DistributedLock.SqlServer/SqlDistributedSynchronizationProvider.md @@ -0,0 +1,32 @@ +#### [DistributedLock.SqlServer](README.md 'README') +### [Medallion.Threading.SqlServer](Medallion.Threading.SqlServer.md 'Medallion.Threading.SqlServer') + +## SqlDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock'), +[IDistributedUpgradeableReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider') for [SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock'), +and [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') for [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore'). + +```csharp +public sealed class SqlDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider, +Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider, +Medallion.Threading.IDistributedReaderWriterLockProvider, +Medallion.Threading.IDistributedSemaphoreProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 SqlDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider'), [IDistributedUpgradeableReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedUpgradeableReaderWriterLockProvider.md 'Medallion.Threading.IDistributedUpgradeableReaderWriterLockProvider'), [IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider'), [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + +| Constructors | | +| :--- | :--- | +| [SqlDistributedSynchronizationProvider(string, Action<SqlConnectionOptionsBuilder>)](SqlDistributedSynchronizationProvider..ctor.uXiGZXEHL3VIEtbm7sJCDw.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string, System.Action)') | Constructs a provider that connects with [connectionString](SqlDistributedSynchronizationProvider..ctor.uXiGZXEHL3VIEtbm7sJCDw.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).connectionString 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](SqlDistributedSynchronizationProvider..ctor.uXiGZXEHL3VIEtbm7sJCDw.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.SqlServer.SqlConnectionOptionsBuilder_).options 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(string, System.Action).options'). | +| [SqlDistributedSynchronizationProvider(IDbConnection)](SqlDistributedSynchronizationProvider..ctor.wIWVEFdYGHcqScaVWCtaYg.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbConnection)') | Constructs a provider that connects with [connection](SqlDistributedSynchronizationProvider..ctor.wIWVEFdYGHcqScaVWCtaYg.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbConnection).connection 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbConnection).connection'). | +| [SqlDistributedSynchronizationProvider(IDbTransaction)](SqlDistributedSynchronizationProvider..ctor.QbNGXebcf9bdcSs15AJxAg.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbTransaction)') | Constructs a provider that connects with [transaction](SqlDistributedSynchronizationProvider..ctor.QbNGXebcf9bdcSs15AJxAg.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbTransaction).transaction 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.SqlDistributedSynchronizationProvider(System.Data.IDbTransaction).transaction'). | + +| Methods | | +| :--- | :--- | +| [CreateLock(string, bool)](SqlDistributedSynchronizationProvider.CreateLock.OBB/tAHXb7DSNADefkuRKg.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string, bool)') | Constructs an instance of [SqlDistributedLock](SqlDistributedLock.md 'Medallion.Threading.SqlServer.SqlDistributedLock') with the provided [name](SqlDistributedSynchronizationProvider.CreateLock.OBB/tAHXb7DSNADefkuRKg.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string,bool).name 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string, bool).name'). Unless [exactName](SqlDistributedSynchronizationProvider.CreateLock.OBB/tAHXb7DSNADefkuRKg.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateLock(string, bool).exactName') is specified, invalid applock names will be escaped/hashed. | +| [CreateReaderWriterLock(string, bool)](SqlDistributedSynchronizationProvider.CreateReaderWriterLock./sU0nmoSgVAlSEihYgHv9Q.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool)') | Constructs an instance of [SqlDistributedReaderWriterLock](SqlDistributedReaderWriterLock.md 'Medallion.Threading.SqlServer.SqlDistributedReaderWriterLock') with the provided [name](SqlDistributedSynchronizationProvider.CreateReaderWriterLock./sU0nmoSgVAlSEihYgHv9Q.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string,bool).name 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool).name'). Unless [exactName](SqlDistributedSynchronizationProvider.CreateReaderWriterLock./sU0nmoSgVAlSEihYgHv9Q.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string,bool).exactName 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateReaderWriterLock(string, bool).exactName') is specified, invalid applock names will be escaped/hashed. | +| [CreateSemaphore(string, int)](SqlDistributedSynchronizationProvider.CreateSemaphore.NU06amMuOL4wYpDoFLZ7sA.md 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string, int)') | Constructs an instance of [SqlDistributedSemaphore](SqlDistributedSemaphore.md 'Medallion.Threading.SqlServer.SqlDistributedSemaphore') with the provided [name](SqlDistributedSynchronizationProvider.CreateSemaphore.NU06amMuOL4wYpDoFLZ7sA.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string,int).name 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string, int).name') and [maxCount](SqlDistributedSynchronizationProvider.CreateSemaphore.NU06amMuOL4wYpDoFLZ7sA.md#Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string,int).maxCount 'Medallion.Threading.SqlServer.SqlDistributedSynchronizationProvider.CreateSemaphore(string, int).maxCount'). | diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md new file mode 100644 index 00000000..54d6a7a8 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md @@ -0,0 +1,28 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') + +## EventWaitHandleDistributedLock(string, Nullable, bool) Constructor + +Constructs a lock with the given [name](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md#Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string,System.Nullable_System.TimeSpan_,bool).name 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool).name'). + +[abandonmentCheckCadence](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md#Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string,System.Nullable_System.TimeSpan_,bool).abandonmentCheckCadence 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool).abandonmentCheckCadence') specifies how frequently we refresh our [System.Threading.EventWaitHandle](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.EventWaitHandle 'System.Threading.EventWaitHandle') object in case it is abandoned by +its original owner. The default is 2s. + +Unless [exactName](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md#Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string,System.Nullable_System.TimeSpan_,bool).exactName 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool).exactName') is specified, [name](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md#Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string,System.Nullable_System.TimeSpan_,bool).name 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public EventWaitHandleDistributedLock(string name, System.Nullable abandonmentCheckCadence=null, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`abandonmentCheckCadence` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.Acquire.csc50wjfYFMfhVMh9f0p5g.md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.Acquire.csc50wjfYFMfhVMh9f0p5g.md new file mode 100644 index 00000000..fa59738f --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.Acquire.csc50wjfYFMfhVMh9f0p5g.md @@ -0,0 +1,37 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') + +## EventWaitHandleDistributedLock.Acquire(Nullable, CancellationToken) Method + +Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (myLock.Acquire(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Acquire.Q+8FXimBZqUrDv5tTRw59w.md 'Medallion.Threading.IDistributedLock.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') +An [EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.AcquireAsync.Q/XRVgkI/77ehHSwgz3+6g.md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.AcquireAsync.Q/XRVgkI/77ehHSwgz3+6g.md new file mode 100644 index 00000000..5dc8171c --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.AcquireAsync.Q/XRVgkI/77ehHSwgz3+6g.md @@ -0,0 +1,37 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') + +## EventWaitHandleDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.Name.md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.Name.md new file mode 100644 index 00000000..82b81bc1 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') + +## EventWaitHandleDistributedLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.TryAcquire.uJMovE7EIAyUhcQlWkoiMg.md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.TryAcquire.uJMovE7EIAyUhcQlWkoiMg.md new file mode 100644 index 00000000..f7a2f31c --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.TryAcquire.uJMovE7EIAyUhcQlWkoiMg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') + +## EventWaitHandleDistributedLock.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock synchronously. Usage: + +```csharp +using (var handle = myLock.TryAcquire(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquire.GcM73KNvUAY5aoOOhgln1g.md 'Medallion.Threading.IDistributedLock.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') +An [EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.TryAcquireAsync.bF7Wpky/IL0puVDTMR7U2w.md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.TryAcquireAsync.bF7Wpky/IL0puVDTMR7U2w.md new file mode 100644 index 00000000..dbe76f6b --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.TryAcquireAsync.bF7Wpky/IL0puVDTMR7U2w.md @@ -0,0 +1,37 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') + +## EventWaitHandleDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +An [EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.md new file mode 100644 index 00000000..ce3b5ae8 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLock.md @@ -0,0 +1,30 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles') + +## EventWaitHandleDistributedLock Class + +A distributed lock based on a global [System.Threading.EventWaitHandle](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.EventWaitHandle 'System.Threading.EventWaitHandle') on Windows. + +```csharp +public sealed class EventWaitHandleDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 EventWaitHandleDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [EventWaitHandleDistributedLock(string, Nullable<TimeSpan>, bool)](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool)') | Constructs a lock with the given [name](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md#Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string,System.Nullable_System.TimeSpan_,bool).name 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool).name'). [abandonmentCheckCadence](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md#Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string,System.Nullable_System.TimeSpan_,bool).abandonmentCheckCadence 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool).abandonmentCheckCadence') specifies how frequently we refresh our [System.Threading.EventWaitHandle](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.EventWaitHandle 'System.Threading.EventWaitHandle') object in case it is abandoned by its original owner. The default is 2s. Unless [exactName](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md#Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string,System.Nullable_System.TimeSpan_,bool).exactName 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool).exactName') is specified, [name](EventWaitHandleDistributedLock..ctor.2Tva732RJcbYY7yOGc2Dtg.md#Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string,System.Nullable_System.TimeSpan_,bool).name 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.EventWaitHandleDistributedLock(string, System.Nullable, bool).name') will be escaped/hashed to ensure name validity. | + +| Properties | | +| :--- | :--- | +| [Name](EventWaitHandleDistributedLock.Name.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](EventWaitHandleDistributedLock.Acquire.csc50wjfYFMfhVMh9f0p5g.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](EventWaitHandleDistributedLock.AcquireAsync.Q/XRVgkI/77ehHSwgz3+6g.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](EventWaitHandleDistributedLock.TryAcquire.uJMovE7EIAyUhcQlWkoiMg.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](EventWaitHandleDistributedLock.TryAcquireAsync.bF7Wpky/IL0puVDTMR7U2w.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.Dispose().md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.Dispose().md new file mode 100644 index 00000000..069a9d47 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') + +## EventWaitHandleDistributedLockHandle.Dispose() Method + +Releases the lock + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..76c22616 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') + +## EventWaitHandleDistributedLockHandle.DisposeAsync() Method + +Releases the lock asynchronously + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.md b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.md new file mode 100644 index 00000000..0f3a42f7 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/EventWaitHandleDistributedLockHandle.md @@ -0,0 +1,22 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles') + +## EventWaitHandleDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class EventWaitHandleDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 EventWaitHandleDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Methods | | +| :--- | :--- | +| [Dispose()](EventWaitHandleDistributedLockHandle.Dispose().md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle.Dispose()') | Releases the lock | +| [DisposeAsync()](EventWaitHandleDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle.DisposeAsync()') | Releases the lock asynchronously | diff --git a/docs/api/DistributedLock.WaitHandles/Medallion.Threading.WaitHandles.md b/docs/api/DistributedLock.WaitHandles/Medallion.Threading.WaitHandles.md new file mode 100644 index 00000000..e2b5318b --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/Medallion.Threading.WaitHandles.md @@ -0,0 +1,11 @@ +#### [DistributedLock.WaitHandles](README.md 'README') + +## Medallion.Threading.WaitHandles Namespace + +| Classes | | +| :--- | :--- | +| [EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') | A distributed lock based on a global [System.Threading.EventWaitHandle](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.EventWaitHandle 'System.Threading.EventWaitHandle') on Windows. | +| [EventWaitHandleDistributedLockHandle](EventWaitHandleDistributedLockHandle.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') | Implements a distributed semaphore based on a global [System.Threading.Semaphore](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Semaphore 'System.Threading.Semaphore') | +| [WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [WaitHandleDistributedSynchronizationProvider](WaitHandleDistributedSynchronizationProvider.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') and [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') for [WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore'). | diff --git a/docs/api/DistributedLock.WaitHandles/README.md b/docs/api/DistributedLock.WaitHandles/README.md new file mode 100644 index 00000000..80d47e42 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.WaitHandles](README.md 'README') + +## DistributedLock.WaitHandles Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles') | | diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md new file mode 100644 index 00000000..200589c2 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md @@ -0,0 +1,32 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') + +## WaitHandleDistributedSemaphore(string, int, Nullable, bool) Constructor + +Constructs a lock with the given [name](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string,int,System.Nullable_System.TimeSpan_,bool).name 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool).name'). + +[abandonmentCheckCadence](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string,int,System.Nullable_System.TimeSpan_,bool).abandonmentCheckCadence 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool).abandonmentCheckCadence') specifies how frequently we refresh our [System.Threading.Semaphore](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Semaphore 'System.Threading.Semaphore') object in case it is abandoned by +its original owner. The default is 2s. + +Unless [exactName](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string,int,System.Nullable_System.TimeSpan_,bool).exactName 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool).exactName') is specified, [name](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string,int,System.Nullable_System.TimeSpan_,bool).name 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool).name') will be escaped/hashed to ensure name validity. + +```csharp +public WaitHandleDistributedSemaphore(string name, int maxCount, System.Nullable abandonmentCheckCadence=null, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`abandonmentCheckCadence` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.Acquire.fanbWVO3U0ELSV89GyikgQ.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.Acquire.fanbWVO3U0ELSV89GyikgQ.md new file mode 100644 index 00000000..83276ebd --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.Acquire.fanbWVO3U0ELSV89GyikgQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') + +## WaitHandleDistributedSemaphore.Acquire(Nullable, CancellationToken) Method + +Acquires a semaphore ticket synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +using (mySemaphore.Acquire(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +public Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle Acquire(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [Acquire(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Acquire.Idy1BAzgGUWQ22QmqRZDsg.md 'Medallion.Threading.IDistributedSemaphore.Acquire(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') +A [WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.AcquireAsync.k9Mv6k/1m4DGGHNWVI0rSw.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.AcquireAsync.k9Mv6k/1m4DGGHNWVI0rSw.md new file mode 100644 index 00000000..33cb3c90 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.AcquireAsync.k9Mv6k/1m4DGGHNWVI0rSw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') + +## WaitHandleDistributedSemaphore.AcquireAsync(Nullable, CancellationToken) Method + +Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await mySemaphore.AcquireAsync(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md 'Medallion.Threading.IDistributedSemaphore.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.MaxCount.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.MaxCount.md new file mode 100644 index 00000000..d927077c --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.MaxCount.md @@ -0,0 +1,15 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') + +## WaitHandleDistributedSemaphore.MaxCount Property + +Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') + +```csharp +public int MaxCount { get; } +``` + +Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.Name.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.Name.md new file mode 100644 index 00000000..079f98e7 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.Name.md @@ -0,0 +1,15 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') + +## WaitHandleDistributedSemaphore.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') + +```csharp +public string Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.TryAcquire.xAXKRX1HdsJVylWBC/+WmA.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.TryAcquire.xAXKRX1HdsJVylWBC/+WmA.md new file mode 100644 index 00000000..a856415b --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.TryAcquire.xAXKRX1HdsJVylWBC/+WmA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') + +## WaitHandleDistributedSemaphore.TryAcquire(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket synchronously. Usage: + +```csharp +using (var handle = mySemaphore.TryAcquire(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +public Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle? TryAcquire(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquire(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquire.G9QqgKI96XBtpNQoUp0RZg.md 'Medallion.Threading.IDistributedSemaphore.TryAcquire(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') +A [WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.TryAcquireAsync.nk6f9CuMtAPqAG7F0UWvSA.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.TryAcquireAsync.nk6f9CuMtAPqAG7F0UWvSA.md new file mode 100644 index 00000000..8731efad --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.TryAcquireAsync.nk6f9CuMtAPqAG7F0UWvSA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') + +## WaitHandleDistributedSemaphore.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket asynchronously. Usage: + +```csharp +await using (var handle = await mySemaphore.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md 'Medallion.Threading.IDistributedSemaphore.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.md new file mode 100644 index 00000000..bceee291 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphore.md @@ -0,0 +1,31 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles') + +## WaitHandleDistributedSemaphore Class + +Implements a distributed semaphore based on a global [System.Threading.Semaphore](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Semaphore 'System.Threading.Semaphore') + +```csharp +public sealed class WaitHandleDistributedSemaphore : +Medallion.Threading.IDistributedSemaphore +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 WaitHandleDistributedSemaphore + +Implements [IDistributedSemaphore](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +| Constructors | | +| :--- | :--- | +| [WaitHandleDistributedSemaphore(string, int, Nullable<TimeSpan>, bool)](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool)') | Constructs a lock with the given [name](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string,int,System.Nullable_System.TimeSpan_,bool).name 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool).name'). [abandonmentCheckCadence](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string,int,System.Nullable_System.TimeSpan_,bool).abandonmentCheckCadence 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool).abandonmentCheckCadence') specifies how frequently we refresh our [System.Threading.Semaphore](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Semaphore 'System.Threading.Semaphore') object in case it is abandoned by its original owner. The default is 2s. Unless [exactName](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string,int,System.Nullable_System.TimeSpan_,bool).exactName 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool).exactName') is specified, [name](WaitHandleDistributedSemaphore..ctor.4ysEtsHFYQ8UNvnVKspCjg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string,int,System.Nullable_System.TimeSpan_,bool).name 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.WaitHandleDistributedSemaphore(string, int, System.Nullable, bool).name') will be escaped/hashed to ensure name validity. | + +| Properties | | +| :--- | :--- | +| [MaxCount](WaitHandleDistributedSemaphore.MaxCount.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.MaxCount') | Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') | +| [Name](WaitHandleDistributedSemaphore.Name.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') | + +| Methods | | +| :--- | :--- | +| [Acquire(Nullable<TimeSpan>, CancellationToken)](WaitHandleDistributedSemaphore.Acquire.fanbWVO3U0ELSV89GyikgQ.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.Acquire(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket synchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](WaitHandleDistributedSemaphore.AcquireAsync.k9Mv6k/1m4DGGHNWVI0rSw.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquire(TimeSpan, CancellationToken)](WaitHandleDistributedSemaphore.TryAcquire.xAXKRX1HdsJVylWBC/+WmA.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.TryAcquire(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket synchronously. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](WaitHandleDistributedSemaphore.TryAcquireAsync.nk6f9CuMtAPqAG7F0UWvSA.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket asynchronously. Usage: | diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.Dispose().md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.Dispose().md new file mode 100644 index 00000000..4c9dd17a --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.Dispose().md @@ -0,0 +1,12 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') + +## WaitHandleDistributedSemaphoreHandle.Dispose() Method + +Releases the semaphore ticket + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.DisposeAsync().md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.DisposeAsync().md new file mode 100644 index 00000000..23f8bfc0 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') + +## WaitHandleDistributedSemaphoreHandle.DisposeAsync() Method + +Releases the semaphore ticket + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.HandleLostToken.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.HandleLostToken.md new file mode 100644 index 00000000..b0d685b4 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSemaphoreHandle](WaitHandleDistributedSemaphoreHandle.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle') + +## WaitHandleDistributedSemaphoreHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.md new file mode 100644 index 00000000..d664c724 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSemaphoreHandle.md @@ -0,0 +1,26 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles') + +## WaitHandleDistributedSemaphoreHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class WaitHandleDistributedSemaphoreHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 WaitHandleDistributedSemaphoreHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](WaitHandleDistributedSemaphoreHandle.HandleLostToken.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [Dispose()](WaitHandleDistributedSemaphoreHandle.Dispose().md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle.Dispose()') | Releases the semaphore ticket | +| [DisposeAsync()](WaitHandleDistributedSemaphoreHandle.DisposeAsync().md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphoreHandle.DisposeAsync()') | Releases the semaphore ticket | diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider..ctor.e6xRwWsJppw/KT0BMNM9Fg.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider..ctor.e6xRwWsJppw/KT0BMNM9Fg.md new file mode 100644 index 00000000..3672cb01 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider..ctor.e6xRwWsJppw/KT0BMNM9Fg.md @@ -0,0 +1,15 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSynchronizationProvider](WaitHandleDistributedSynchronizationProvider.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider') + +## WaitHandleDistributedSynchronizationProvider(Nullable) Constructor + +Constructs a [WaitHandleDistributedSynchronizationProvider](WaitHandleDistributedSynchronizationProvider.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider') using the provided [abandonmentCheckCadence](WaitHandleDistributedSynchronizationProvider..ctor.e6xRwWsJppw/KT0BMNM9Fg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.WaitHandleDistributedSynchronizationProvider(System.Nullable_System.TimeSpan_).abandonmentCheckCadence 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.WaitHandleDistributedSynchronizationProvider(System.Nullable).abandonmentCheckCadence'). + +```csharp +public WaitHandleDistributedSynchronizationProvider(System.Nullable abandonmentCheckCadence=null); +``` +#### Parameters + + + +`abandonmentCheckCadence` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.CreateLock.+f5b/NJBO/BPj27n2I4gbA.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.CreateLock.+f5b/NJBO/BPj27n2I4gbA.md new file mode 100644 index 00000000..1616af4f --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.CreateLock.+f5b/NJBO/BPj27n2I4gbA.md @@ -0,0 +1,23 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSynchronizationProvider](WaitHandleDistributedSynchronizationProvider.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider') + +## WaitHandleDistributedSynchronizationProvider.CreateLock(string, bool) Method + +Creates a [EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') with the given [name](WaitHandleDistributedSynchronizationProvider.CreateLock.+f5b/NJBO/BPj27n2I4gbA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string,bool).name 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string, bool).name'). Unless +[exactName](WaitHandleDistributedSynchronizationProvider.CreateLock.+f5b/NJBO/BPj27n2I4gbA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string,bool).exactName 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string, bool).exactName') is specified, invalid wait handle names will be escaped/hashed. + +```csharp +public Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock CreateLock(string name, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md new file mode 100644 index 00000000..cea59a13 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md @@ -0,0 +1,28 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles').[WaitHandleDistributedSynchronizationProvider](WaitHandleDistributedSynchronizationProvider.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider') + +## WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string, int, bool) Method + +Creates a [WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') with the given [name](WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string,int,bool).name 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string, int, bool).name') +and [maxCount](WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string,int,bool).maxCount 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string, int, bool).maxCount'). Unless [exactName](WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string,int,bool).exactName 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string, int, bool).exactName') is specified, invalid wait +handle names will be escaped/hashed. + +```csharp +public Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore CreateSemaphore(string name, int maxCount, bool exactName=false); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`exactName` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Returns +[WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') \ No newline at end of file diff --git a/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.md b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.md new file mode 100644 index 00000000..0b9a9b48 --- /dev/null +++ b/docs/api/DistributedLock.WaitHandles/WaitHandleDistributedSynchronizationProvider.md @@ -0,0 +1,26 @@ +#### [DistributedLock.WaitHandles](README.md 'README') +### [Medallion.Threading.WaitHandles](Medallion.Threading.WaitHandles.md 'Medallion.Threading.WaitHandles') + +## WaitHandleDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') +and [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') for [WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore'). + +```csharp +public sealed class WaitHandleDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider, +Medallion.Threading.IDistributedSemaphoreProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 WaitHandleDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider'), [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + +| Constructors | | +| :--- | :--- | +| [WaitHandleDistributedSynchronizationProvider(Nullable<TimeSpan>)](WaitHandleDistributedSynchronizationProvider..ctor.e6xRwWsJppw/KT0BMNM9Fg.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.WaitHandleDistributedSynchronizationProvider(System.Nullable)') | Constructs a [WaitHandleDistributedSynchronizationProvider](WaitHandleDistributedSynchronizationProvider.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider') using the provided [abandonmentCheckCadence](WaitHandleDistributedSynchronizationProvider..ctor.e6xRwWsJppw/KT0BMNM9Fg.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.WaitHandleDistributedSynchronizationProvider(System.Nullable_System.TimeSpan_).abandonmentCheckCadence 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.WaitHandleDistributedSynchronizationProvider(System.Nullable).abandonmentCheckCadence'). | + +| Methods | | +| :--- | :--- | +| [CreateLock(string, bool)](WaitHandleDistributedSynchronizationProvider.CreateLock.+f5b/NJBO/BPj27n2I4gbA.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string, bool)') | Creates a [EventWaitHandleDistributedLock](EventWaitHandleDistributedLock.md 'Medallion.Threading.WaitHandles.EventWaitHandleDistributedLock') with the given [name](WaitHandleDistributedSynchronizationProvider.CreateLock.+f5b/NJBO/BPj27n2I4gbA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string,bool).name 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string, bool).name'). Unless [exactName](WaitHandleDistributedSynchronizationProvider.CreateLock.+f5b/NJBO/BPj27n2I4gbA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string,bool).exactName 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateLock(string, bool).exactName') is specified, invalid wait handle names will be escaped/hashed. | +| [CreateSemaphore(string, int, bool)](WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string, int, bool)') | Creates a [WaitHandleDistributedSemaphore](WaitHandleDistributedSemaphore.md 'Medallion.Threading.WaitHandles.WaitHandleDistributedSemaphore') with the given [name](WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string,int,bool).name 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string, int, bool).name') and [maxCount](WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string,int,bool).maxCount 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string, int, bool).maxCount'). Unless [exactName](WaitHandleDistributedSynchronizationProvider.CreateSemaphore.lScE6Nm5quO4w5D+oiHGrA.md#Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string,int,bool).exactName 'Medallion.Threading.WaitHandles.WaitHandleDistributedSynchronizationProvider.CreateSemaphore(string, int, bool).exactName') is specified, invalid wait handle names will be escaped/hashed. | diff --git a/docs/api/DistributedLock.ZooKeeper/Medallion.Threading.ZooKeeper.md b/docs/api/DistributedLock.ZooKeeper/Medallion.Threading.ZooKeeper.md new file mode 100644 index 00000000..0ca28c50 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/Medallion.Threading.ZooKeeper.md @@ -0,0 +1,18 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') + +## Medallion.Threading.ZooKeeper Namespace + +| Classes | | +| :--- | :--- | +| [ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') | An implementation of [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') based on ZooKeeper. Uses the lock recipe described in https://zookeeper.apache.org/doc/r3.1.2/recipes.html | +| [ZooKeeperDistributedLockHandle](ZooKeeperDistributedLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') | A distributed reader-writer lock based on the ZooKeeper shared lock recipe (https://zookeeper.apache.org/doc/current/recipes.html). | +| [ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') | An implementation of [IDistributedSemaphore](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') based on ZooKeeper. Uses an approach similar to [ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock'). | +| [ZooKeeperDistributedSemaphoreHandle](ZooKeeperDistributedSemaphoreHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle') | Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') | +| [ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') | Options for configuring ZooKeeper-based synchronization primitives | +| [ZooKeeperDistributedSynchronizationProvider](ZooKeeperDistributedSynchronizationProvider.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider') | Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock'), [IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') for [ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock'), and [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') for [ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore'). | + +| Structs | | +| :--- | :--- | +| [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') | Represents a path to a ZooKeeper node. The constructor validates that the input is a valid path. Call [ToString()](ZooKeeperPath.ToString().md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.ToString()') to get the path value. | diff --git a/docs/api/DistributedLock.ZooKeeper/README.md b/docs/api/DistributedLock.ZooKeeper/README.md new file mode 100644 index 00000000..a26328e5 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/README.md @@ -0,0 +1,7 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') + +## DistributedLock.ZooKeeper Assembly + +| Namespaces | | +| :--- | :--- | +| [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') | | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md new file mode 100644 index 00000000..b8d8b944 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md @@ -0,0 +1,30 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') + +## ZooKeeperDistributedLock(ZooKeeperPath, string, bool, Action) Constructor + +Constructs a new lock based on the provided [path](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).path 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).path'), [connectionString](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).connectionString'), and [options](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).options'). + +If [assumePathExists](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).assumePathExists 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).assumePathExists') is specified, then the node will not be created as part of acquiring nor will it be +deleted after releasing (defaults to false). + +```csharp +public ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath path, string connectionString, bool assumePathExists=false, System.Action? options=null); +``` +#### Parameters + + + +`path` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`assumePathExists` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md new file mode 100644 index 00000000..853b8afd --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md @@ -0,0 +1,26 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') + +## ZooKeeperDistributedLock(string, string, Action) Constructor + +Constructs a new lock based on the provided [name](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action).name'), [connectionString](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action).connectionString'), and [options](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action).options'). + +The lock's path will be a parent node of the root directory '/'. If [name](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action).name') is not a valid node name, it will be transformed to ensure +validity. + +```csharp +public ZooKeeperDistributedLock(string name, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md new file mode 100644 index 00000000..84914855 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md @@ -0,0 +1,30 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') + +## ZooKeeperDistributedLock(ZooKeeperPath, string, string, Action) Constructor + +Constructs a new lock based on the provided [directoryPath](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).directoryPath'), [name](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).name'), [connectionString](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).connectionString'), and [options](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).options'). + +The lock's path will be a parent node of [directoryPath](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).directoryPath'). If [name](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).name') is not a valid node name, it will be transformed to ensure +validity. + +```csharp +public ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath directoryPath, string name, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`directoryPath` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.AcquireAsync.dX8Tx1oYTmer5I2nEBAsSA.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.AcquireAsync.dX8Tx1oYTmer5I2nEBAsSA.md new file mode 100644 index 00000000..3c338590 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.AcquireAsync.dX8Tx1oYTmer5I2nEBAsSA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') + +## ZooKeeperDistributedLock.AcquireAsync(Nullable, CancellationToken) Method + +Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await myLock.AcquireAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.AcquireAsync.0Lol7Hv58Kl+UVYSOI6IpQ.md 'Medallion.Threading.IDistributedLock.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[ZooKeeperDistributedLockHandle](ZooKeeperDistributedLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [ZooKeeperDistributedLockHandle](ZooKeeperDistributedLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.Medallion.Threading.IDistributedLock.Name.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.Medallion.Threading.IDistributedLock.Name.md new file mode 100644 index 00000000..23d5c01c --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.Medallion.Threading.IDistributedLock.Name.md @@ -0,0 +1,13 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') + +## ZooKeeperDistributedLock.Medallion.Threading.IDistributedLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name'). Implemented explicitly to avoid confusion with the fact +that this will include the leading "/" and base directory alongside the passed-in name. + +```csharp +string Medallion.Threading.IDistributedLock.Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.Path.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.Path.md new file mode 100644 index 00000000..ccdff704 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.Path.md @@ -0,0 +1,13 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') + +## ZooKeeperDistributedLock.Path Property + +The zookeeper node path + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperPath Path { get; } +``` + +#### Property Value +[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.TryAcquireAsync.dE6fPlJgcH/Osz5FH2DXIg.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.TryAcquireAsync.dE6fPlJgcH/Osz5FH2DXIg.md new file mode 100644 index 00000000..f1812655 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.TryAcquireAsync.dE6fPlJgcH/Osz5FH2DXIg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') + +## ZooKeeperDistributedLock.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire the lock asynchronously. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.TryAcquireAsync.ZLhweq3GadK5OwGmTwruEQ.md 'Medallion.Threading.IDistributedLock.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[ZooKeeperDistributedLockHandle](ZooKeeperDistributedLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [ZooKeeperDistributedLockHandle](ZooKeeperDistributedLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.md new file mode 100644 index 00000000..3a08353b --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLock.md @@ -0,0 +1,35 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperDistributedLock Class + +An implementation of [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') based on ZooKeeper. Uses the lock recipe described in +https://zookeeper.apache.org/doc/r3.1.2/recipes.html + +```csharp +public sealed class ZooKeeperDistributedLock : +Medallion.Threading.IDistributedLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 ZooKeeperDistributedLock + +Implements [IDistributedLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.md 'Medallion.Threading.IDistributedLock') + +| Constructors | | +| :--- | :--- | +| [ZooKeeperDistributedLock(ZooKeeperPath, string, bool, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action)') | Constructs a new lock based on the provided [path](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).path 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).path'), [connectionString](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).connectionString'), and [options](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).options'). If [assumePathExists](ZooKeeperDistributedLock..ctor.T8t39/JnVaogxN4UVbbBww.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).assumePathExists 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).assumePathExists') is specified, then the node will not be created as part of acquiring nor will it be deleted after releasing (defaults to false). | +| [ZooKeeperDistributedLock(ZooKeeperPath, string, string, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action)') | Constructs a new lock based on the provided [directoryPath](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).directoryPath'), [name](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).name'), [connectionString](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).connectionString'), and [options](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).options'). The lock's path will be a parent node of [directoryPath](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).directoryPath'). If [name](ZooKeeperDistributedLock..ctor.oGOX/TLwd8GsE6eSegfTOg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).name') is not a valid node name, it will be transformed to ensure validity. | +| [ZooKeeperDistributedLock(string, string, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action)') | Constructs a new lock based on the provided [name](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action).name'), [connectionString](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action).connectionString'), and [options](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action).options'). The lock's path will be a parent node of the root directory '/'. If [name](ZooKeeperDistributedLock..ctor.YD0f/J7K06jJzbPO75s7Pg.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.ZooKeeperDistributedLock(string, string, System.Action).name') is not a valid node name, it will be transformed to ensure validity. | + +| Properties | | +| :--- | :--- | +| [Path](ZooKeeperDistributedLock.Path.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.Path') | The zookeeper node path | + +| Methods | | +| :--- | :--- | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](ZooKeeperDistributedLock.AcquireAsync.dX8Tx1oYTmer5I2nEBAsSA.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires the lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](ZooKeeperDistributedLock.TryAcquireAsync.dE6fPlJgcH/Osz5FH2DXIg.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire the lock asynchronously. Usage: | + +| Explicit Interface Implementations | | +| :--- | :--- | +| [Medallion.Threading.IDistributedLock.Name](ZooKeeperDistributedLock.Medallion.Threading.IDistributedLock.Name.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock.Medallion.Threading.IDistributedLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLock.Name.md 'Medallion.Threading.IDistributedLock.Name'). Implemented explicitly to avoid confusion with the fact that this will include the leading "/" and base directory alongside the passed-in name. | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.DisposeAsync().md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.DisposeAsync().md new file mode 100644 index 00000000..7ffe9f97 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLockHandle](ZooKeeperDistributedLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle') + +## ZooKeeperDistributedLockHandle.DisposeAsync() Method + +Releases the lock + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.HandleLostToken.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.HandleLostToken.md new file mode 100644 index 00000000..18a694f4 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedLockHandle](ZooKeeperDistributedLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle') + +## ZooKeeperDistributedLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.md new file mode 100644 index 00000000..889bd301 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedLockHandle.md @@ -0,0 +1,25 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperDistributedLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class ZooKeeperDistributedLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 ZooKeeperDistributedLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](ZooKeeperDistributedLockHandle.HandleLostToken.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [DisposeAsync()](ZooKeeperDistributedLockHandle.DisposeAsync().md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLockHandle.DisposeAsync()') | Releases the lock | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md new file mode 100644 index 00000000..50803513 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md @@ -0,0 +1,30 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock(ZooKeeperPath, string, string, Action) Constructor + +Constructs a new lock based on the provided [directoryPath](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).directoryPath'), [name](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).name'), [connectionString](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).connectionString'), and [options](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).options'). + +The lock's path will be a parent node of [directoryPath](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).directoryPath'). If [name](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).name') is not a valid node name, it will be transformed to ensure +validity. + +```csharp +public ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath directoryPath, string name, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`directoryPath` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md new file mode 100644 index 00000000..5e0120ef --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md @@ -0,0 +1,30 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock(ZooKeeperPath, string, bool, Action) Constructor + +Constructs a new lock based on the provided [path](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).path 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).path'), [connectionString](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).connectionString'), and [options](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).options'). + +If [assumePathExists](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).assumePathExists 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).assumePathExists') is specified, then the node will not be created as part of acquiring nor will it be +deleted after releasing (defaults to false). + +```csharp +public ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath path, string connectionString, bool assumePathExists=false, System.Action? options=null); +``` +#### Parameters + + + +`path` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`assumePathExists` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md new file mode 100644 index 00000000..4ab6e9b5 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md @@ -0,0 +1,26 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock(string, string, Action) Constructor + +Constructs a new lock based on the provided [name](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action).name'), [connectionString](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action).connectionString'), and [options](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action).options'). + +The lock's path will be a parent node of the root directory '/'. If [name](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action).name') is not a valid node name, it will be transformed to ensure +validity. + +```csharp +public ZooKeeperDistributedReaderWriterLock(string name, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.AcquireReadLockAsync.CZZdkDZUKDMC66TavV6oKQ.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.AcquireReadLockAsync.CZZdkDZUKDMC66TavV6oKQ.md new file mode 100644 index 00000000..a3d81184 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.AcquireReadLockAsync.CZZdkDZUKDMC66TavV6oKQ.md @@ -0,0 +1,37 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock.AcquireReadLockAsync(Nullable, CancellationToken) Method + +Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (await myLock.AcquireReadLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireReadLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireReadLockAsync.otuQSEhQpAEqEEBnyFJHtw.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.AcquireWriteLockAsync.C0NA4I3hjc7zPn4ctLMeLg.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.AcquireWriteLockAsync.C0NA4I3hjc7zPn4ctLMeLg.md new file mode 100644 index 00000000..e73297d6 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.AcquireWriteLockAsync.C0NA4I3hjc7zPn4ctLMeLg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock.AcquireWriteLockAsync(Nullable, CancellationToken) Method + +Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (await myLock.AcquireWriteLockAsync(...)) +{ + /* we have the lock! */ +} +// dispose releases the lock +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireWriteLockAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.AcquireWriteLockAsync.fFyCc0HswQXUnGvjzNHJ+A.md 'Medallion.Threading.IDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle') which can be used to release the lock \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.Medallion.Threading.IDistributedReaderWriterLock.Name.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.Medallion.Threading.IDistributedReaderWriterLock.Name.md new file mode 100644 index 00000000..b04bc81c --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.Medallion.Threading.IDistributedReaderWriterLock.Name.md @@ -0,0 +1,13 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock.Medallion.Threading.IDistributedReaderWriterLock.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name'). Implemented explicitly to avoid confusion with the fact +that this will include the leading "/" and base directory alongside the passed-in name. + +```csharp +string Medallion.Threading.IDistributedReaderWriterLock.Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.Path.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.Path.md new file mode 100644 index 00000000..43af9eeb --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.Path.md @@ -0,0 +1,13 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock.Path Property + +The zookeeper node path + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperPath Path { get; } +``` + +#### Property Value +[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.TryAcquireReadLockAsync.rS7MPpWE2xY2RE8T3qxudw.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.TryAcquireReadLockAsync.rS7MPpWE2xY2RE8T3qxudw.md new file mode 100644 index 00000000..fd067bdd --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.TryAcquireReadLockAsync.rS7MPpWE2xY2RE8T3qxudw.md @@ -0,0 +1,37 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock.TryAcquireReadLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireReadLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireReadLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireReadLockAsync.1wx2S+CeVe62/fKwnr3rNQ.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.TryAcquireWriteLockAsync.91WGFH9dXQfYepWYj84Epg.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.TryAcquireWriteLockAsync.91WGFH9dXQfYepWYj84Epg.md new file mode 100644 index 00000000..eda088d0 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.TryAcquireWriteLockAsync.91WGFH9dXQfYepWYj84Epg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') + +## ZooKeeperDistributedReaderWriterLock.TryAcquireWriteLockAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: + +```csharp +await using (var handle = await myLock.TryAcquireWriteLockAsync(...)) +{ + if (handle != null) { /* we have the lock! */ } +} +// dispose releases the lock if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireWriteLockAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.TryAcquireWriteLockAsync.yhTsitSwERpacPdxWmUvww.md 'Medallion.Threading.IDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle') which can be used to release the lock or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.md new file mode 100644 index 00000000..91fadbe9 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLock.md @@ -0,0 +1,36 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperDistributedReaderWriterLock Class + +A distributed reader-writer lock based on the ZooKeeper shared lock recipe (https://zookeeper.apache.org/doc/current/recipes.html). + +```csharp +public sealed class ZooKeeperDistributedReaderWriterLock : +Medallion.Threading.IDistributedReaderWriterLock +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 ZooKeeperDistributedReaderWriterLock + +Implements [IDistributedReaderWriterLock](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.md 'Medallion.Threading.IDistributedReaderWriterLock') + +| Constructors | | +| :--- | :--- | +| [ZooKeeperDistributedReaderWriterLock(ZooKeeperPath, string, bool, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action)') | Constructs a new lock based on the provided [path](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).path 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).path'), [connectionString](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).connectionString'), and [options](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).options'). If [assumePathExists](ZooKeeperDistributedReaderWriterLock..ctor.GPpUchrSAGRP7iRQsT+Qvw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).assumePathExists 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, bool, System.Action).assumePathExists') is specified, then the node will not be created as part of acquiring nor will it be deleted after releasing (defaults to false). | +| [ZooKeeperDistributedReaderWriterLock(ZooKeeperPath, string, string, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action)') | Constructs a new lock based on the provided [directoryPath](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).directoryPath'), [name](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).name'), [connectionString](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).connectionString'), and [options](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).options'). The lock's path will be a parent node of [directoryPath](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).directoryPath'). If [name](ZooKeeperDistributedReaderWriterLock..ctor.AXhGVqfGNT1g+R+FvctbsQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, string, System.Action).name') is not a valid node name, it will be transformed to ensure validity. | +| [ZooKeeperDistributedReaderWriterLock(string, string, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action)') | Constructs a new lock based on the provided [name](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action).name'), [connectionString](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action).connectionString'), and [options](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action).options'). The lock's path will be a parent node of the root directory '/'. If [name](ZooKeeperDistributedReaderWriterLock..ctor.UBffuya5D0MaaTKQLo9/wQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.ZooKeeperDistributedReaderWriterLock(string, string, System.Action).name') is not a valid node name, it will be transformed to ensure validity. | + +| Properties | | +| :--- | :--- | +| [Path](ZooKeeperDistributedReaderWriterLock.Path.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.Path') | The zookeeper node path | + +| Methods | | +| :--- | :--- | +| [AcquireReadLockAsync(Nullable<TimeSpan>, CancellationToken)](ZooKeeperDistributedReaderWriterLock.AcquireReadLockAsync.CZZdkDZUKDMC66TavV6oKQ.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.AcquireReadLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a READ lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [AcquireWriteLockAsync(Nullable<TimeSpan>, CancellationToken)](ZooKeeperDistributedReaderWriterLock.AcquireWriteLockAsync.C0NA4I3hjc7zPn4ctLMeLg.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.AcquireWriteLockAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a WRITE lock asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | +| [TryAcquireReadLockAsync(TimeSpan, CancellationToken)](ZooKeeperDistributedReaderWriterLock.TryAcquireReadLockAsync.rS7MPpWE2xY2RE8T3qxudw.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.TryAcquireReadLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a READ lock asynchronously. Multiple readers are allowed. Not compatible with a WRITE lock. Usage: | +| [TryAcquireWriteLockAsync(TimeSpan, CancellationToken)](ZooKeeperDistributedReaderWriterLock.TryAcquireWriteLockAsync.91WGFH9dXQfYepWYj84Epg.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.TryAcquireWriteLockAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a WRITE lock asynchronously. Not compatible with another WRITE lock or an UPGRADE lock. Usage: | + +| Explicit Interface Implementations | | +| :--- | :--- | +| [Medallion.Threading.IDistributedReaderWriterLock.Name](ZooKeeperDistributedReaderWriterLock.Medallion.Threading.IDistributedReaderWriterLock.Name.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock.Medallion.Threading.IDistributedReaderWriterLock.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLock.Name.md 'Medallion.Threading.IDistributedReaderWriterLock.Name'). Implemented explicitly to avoid confusion with the fact that this will include the leading "/" and base directory alongside the passed-in name. | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.DisposeAsync().md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.DisposeAsync().md new file mode 100644 index 00000000..17c393f3 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle') + +## ZooKeeperDistributedReaderWriterLockHandle.DisposeAsync() Method + +Releases the lock + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.HandleLostToken.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.HandleLostToken.md new file mode 100644 index 00000000..a63346a2 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedReaderWriterLockHandle](ZooKeeperDistributedReaderWriterLockHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle') + +## ZooKeeperDistributedReaderWriterLockHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.md new file mode 100644 index 00000000..07421830 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedReaderWriterLockHandle.md @@ -0,0 +1,25 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperDistributedReaderWriterLockHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class ZooKeeperDistributedReaderWriterLockHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 ZooKeeperDistributedReaderWriterLockHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](ZooKeeperDistributedReaderWriterLockHandle.HandleLostToken.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [DisposeAsync()](ZooKeeperDistributedReaderWriterLockHandle.DisposeAsync().md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLockHandle.DisposeAsync()') | Releases the lock | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md new file mode 100644 index 00000000..2e646468 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md @@ -0,0 +1,34 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') + +## ZooKeeperDistributedSemaphore(ZooKeeperPath, int, string, bool, Action) Constructor + +Constructs a new semaphore based on the provided [path](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,int,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).path 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action).path'), [connectionString](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,int,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action).connectionString'), and [options](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,int,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action).options'). + +If [assumePathExists](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,int,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).assumePathExists 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action).assumePathExists') is specified, then the node will not be created as part of acquiring nor will it be +deleted after releasing (defaults to false). + +```csharp +public ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath path, int maxCount, string connectionString, bool assumePathExists=false, System.Action? options=null); +``` +#### Parameters + + + +`path` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`assumePathExists` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md new file mode 100644 index 00000000..3a16c255 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md @@ -0,0 +1,34 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') + +## ZooKeeperDistributedSemaphore(ZooKeeperPath, string, int, string, Action) Constructor + +Constructs a new semaphore based on the provided [directoryPath](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).directoryPath'), [name](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).name'), [connectionString](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).connectionString'), and [options](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).options'). + +The semaphore's path will be a parent node of [directoryPath](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).directoryPath'). If [name](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).name') is not a valid node name, it will be transformed to ensure +validity. + +```csharp +public ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath directoryPath, string name, int maxCount, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`directoryPath` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md new file mode 100644 index 00000000..b5f1f8d8 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md @@ -0,0 +1,30 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') + +## ZooKeeperDistributedSemaphore(string, int, string, Action) Constructor + +Constructs a new semaphore based on the provided [name](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action).name'), [connectionString](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action).connectionString'), and [options](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action).options'). + +The semaphore's path will be a parent node of the root directory '/'. If [name](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action).name') is not a valid node name, it will be transformed to ensure +validity. + +```csharp +public ZooKeeperDistributedSemaphore(string name, int maxCount, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.AcquireAsync.FRq4bLc63K5HTCCEHhCigg.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.AcquireAsync.FRq4bLc63K5HTCCEHhCigg.md new file mode 100644 index 00000000..c24226ce --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.AcquireAsync.FRq4bLc63K5HTCCEHhCigg.md @@ -0,0 +1,37 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') + +## ZooKeeperDistributedSemaphore.AcquireAsync(Nullable, CancellationToken) Method + +Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: + +```csharp +await using (await mySemaphore.AcquireAsync(...)) +{ + /* we have the ticket! */ +} +// dispose releases the ticket +``` + +```csharp +public System.Threading.Tasks.ValueTask AcquireAsync(System.Nullable timeout=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') + +How long to wait before giving up on the acquisition attempt. Defaults to [System.Threading.Timeout.InfiniteTimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Timeout.InfiniteTimeSpan 'System.Threading.Timeout.InfiniteTimeSpan') + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.AcquireAsync.72hbd/OOOHUBoRAQHgD31Q.md 'Medallion.Threading.IDistributedSemaphore.AcquireAsync(System.Nullable{System.TimeSpan},System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[ZooKeeperDistributedSemaphoreHandle](ZooKeeperDistributedSemaphoreHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [ZooKeeperDistributedSemaphoreHandle](ZooKeeperDistributedSemaphoreHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle') which can be used to release the ticket \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.MaxCount.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.MaxCount.md new file mode 100644 index 00000000..cc1bf303 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.MaxCount.md @@ -0,0 +1,15 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') + +## ZooKeeperDistributedSemaphore.MaxCount Property + +Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') + +```csharp +public int MaxCount { get; } +``` + +Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.Medallion.Threading.IDistributedSemaphore.Name.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.Medallion.Threading.IDistributedSemaphore.Name.md new file mode 100644 index 00000000..702dff98 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.Medallion.Threading.IDistributedSemaphore.Name.md @@ -0,0 +1,13 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') + +## ZooKeeperDistributedSemaphore.Medallion.Threading.IDistributedSemaphore.Name Property + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name'). Implemented explicitly to avoid confusion with the fact +that this will include the leading "/" and base directory alongside the passed-in name. + +```csharp +string Medallion.Threading.IDistributedSemaphore.Name { get; } +``` + +Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.Path.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.Path.md new file mode 100644 index 00000000..b9335d65 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.Path.md @@ -0,0 +1,13 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') + +## ZooKeeperDistributedSemaphore.Path Property + +The zookeeper node path + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperPath Path { get; } +``` + +#### Property Value +[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.TryAcquireAsync.9Sm3yQ3LE3ZAN2gEjF09kA.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.TryAcquireAsync.9Sm3yQ3LE3ZAN2gEjF09kA.md new file mode 100644 index 00000000..298fc53f --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.TryAcquireAsync.9Sm3yQ3LE3ZAN2gEjF09kA.md @@ -0,0 +1,37 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') + +## ZooKeeperDistributedSemaphore.TryAcquireAsync(TimeSpan, CancellationToken) Method + +Attempts to acquire a semaphore ticket asynchronously. Usage: + +```csharp +await using (var handle = await mySemaphore.TryAcquireAsync(...)) +{ + if (handle != null) { /* we have the ticket! */ } +} +// dispose releases the ticket if we took it +``` + +```csharp +public System.Threading.Tasks.ValueTask TryAcquireAsync(System.TimeSpan timeout=default(System.TimeSpan), System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken)); +``` +#### Parameters + + + +`timeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +How long to wait before giving up on the acquisition attempt. Defaults to 0 + + + +`cancellationToken` [System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') + +Specifies a token by which the wait can be canceled + +Implements [TryAcquireAsync(TimeSpan, CancellationToken)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.TryAcquireAsync.yTpJMeiQTyO40ByV0nmdkQ.md 'Medallion.Threading.IDistributedSemaphore.TryAcquireAsync(System.TimeSpan,System.Threading.CancellationToken)') + +#### Returns +[System.Threading.Tasks.ValueTask<](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1')[ZooKeeperDistributedSemaphoreHandle](ZooKeeperDistributedSemaphoreHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask-1 'System.Threading.Tasks.ValueTask`1') +A [ZooKeeperDistributedSemaphoreHandle](ZooKeeperDistributedSemaphoreHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle') which can be used to release the ticket or null on failure \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.md new file mode 100644 index 00000000..e96a0388 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphore.md @@ -0,0 +1,35 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperDistributedSemaphore Class + +An implementation of [IDistributedSemaphore](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') based on ZooKeeper. Uses an approach similar to [ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock'). + +```csharp +public sealed class ZooKeeperDistributedSemaphore : +Medallion.Threading.IDistributedSemaphore +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 ZooKeeperDistributedSemaphore + +Implements [IDistributedSemaphore](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.md 'Medallion.Threading.IDistributedSemaphore') + +| Constructors | | +| :--- | :--- | +| [ZooKeeperDistributedSemaphore(ZooKeeperPath, int, string, bool, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action)') | Constructs a new semaphore based on the provided [path](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,int,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).path 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action).path'), [connectionString](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,int,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action).connectionString'), and [options](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,int,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action).options'). If [assumePathExists](ZooKeeperDistributedSemaphore..ctor.Ceq6ePeXhFqMiSyLs3JHqQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,int,string,bool,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).assumePathExists 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, int, string, bool, System.Action).assumePathExists') is specified, then the node will not be created as part of acquiring nor will it be deleted after releasing (defaults to false). | +| [ZooKeeperDistributedSemaphore(ZooKeeperPath, string, int, string, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action)') | Constructs a new semaphore based on the provided [directoryPath](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).directoryPath'), [name](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).name'), [connectionString](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).connectionString'), and [options](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).options'). The semaphore's path will be a parent node of [directoryPath](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).directoryPath'). If [name](ZooKeeperDistributedSemaphore..ctor.NXXFG0kJwyz4rwDbslWqzw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, int, string, System.Action).name') is not a valid node name, it will be transformed to ensure validity. | +| [ZooKeeperDistributedSemaphore(string, int, string, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action)') | Constructs a new semaphore based on the provided [name](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action).name'), [connectionString](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action).connectionString'), and [options](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action).options'). The semaphore's path will be a parent node of the root directory '/'. If [name](ZooKeeperDistributedSemaphore..ctor.ceNJY9cjGCQ/TgjjnsQT9A.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string,int,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.ZooKeeperDistributedSemaphore(string, int, string, System.Action).name') is not a valid node name, it will be transformed to ensure validity. | + +| Properties | | +| :--- | :--- | +| [MaxCount](ZooKeeperDistributedSemaphore.MaxCount.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.MaxCount') | Implements [MaxCount](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.MaxCount.md 'Medallion.Threading.IDistributedSemaphore.MaxCount') | +| [Path](ZooKeeperDistributedSemaphore.Path.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.Path') | The zookeeper node path | + +| Methods | | +| :--- | :--- | +| [AcquireAsync(Nullable<TimeSpan>, CancellationToken)](ZooKeeperDistributedSemaphore.AcquireAsync.FRq4bLc63K5HTCCEHhCigg.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.AcquireAsync(System.Nullable, System.Threading.CancellationToken)') | Acquires a semaphore ticket asynchronously, failing with [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException') if the attempt times out. Usage: | +| [TryAcquireAsync(TimeSpan, CancellationToken)](ZooKeeperDistributedSemaphore.TryAcquireAsync.9Sm3yQ3LE3ZAN2gEjF09kA.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.TryAcquireAsync(System.TimeSpan, System.Threading.CancellationToken)') | Attempts to acquire a semaphore ticket asynchronously. Usage: | + +| Explicit Interface Implementations | | +| :--- | :--- | +| [Medallion.Threading.IDistributedSemaphore.Name](ZooKeeperDistributedSemaphore.Medallion.Threading.IDistributedSemaphore.Name.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore.Medallion.Threading.IDistributedSemaphore.Name') | Implements [Name](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphore.Name.md 'Medallion.Threading.IDistributedSemaphore.Name'). Implemented explicitly to avoid confusion with the fact that this will include the leading "/" and base directory alongside the passed-in name. | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.DisposeAsync().md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.DisposeAsync().md new file mode 100644 index 00000000..38184e66 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.DisposeAsync().md @@ -0,0 +1,15 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphoreHandle](ZooKeeperDistributedSemaphoreHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle') + +## ZooKeeperDistributedSemaphoreHandle.DisposeAsync() Method + +Releases the semaphore + +```csharp +public System.Threading.Tasks.ValueTask DisposeAsync(); +``` + +Implements [DisposeAsync()](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable.DisposeAsync 'System.IAsyncDisposable.DisposeAsync') + +#### Returns +[System.Threading.Tasks.ValueTask](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.ValueTask 'System.Threading.Tasks.ValueTask') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.HandleLostToken.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.HandleLostToken.md new file mode 100644 index 00000000..2e801043 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.HandleLostToken.md @@ -0,0 +1,15 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSemaphoreHandle](ZooKeeperDistributedSemaphoreHandle.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle') + +## ZooKeeperDistributedSemaphoreHandle.HandleLostToken Property + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +```csharp +public System.Threading.CancellationToken HandleLostToken { get; } +``` + +Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') + +#### Property Value +[System.Threading.CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.CancellationToken 'System.Threading.CancellationToken') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.md new file mode 100644 index 00000000..48e8f938 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSemaphoreHandle.md @@ -0,0 +1,25 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperDistributedSemaphoreHandle Class + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle') + +```csharp +public sealed class ZooKeeperDistributedSemaphoreHandle : +Medallion.Threading.IDistributedSynchronizationHandle, +System.IDisposable, +System.IAsyncDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 ZooKeeperDistributedSemaphoreHandle + +Implements [IDistributedSynchronizationHandle](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.md 'Medallion.Threading.IDistributedSynchronizationHandle'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [System.IAsyncDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IAsyncDisposable 'System.IAsyncDisposable') + +| Properties | | +| :--- | :--- | +| [HandleLostToken](ZooKeeperDistributedSemaphoreHandle.HandleLostToken.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle.HandleLostToken') | Implements [HandleLostToken](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSynchronizationHandle.HandleLostToken.md 'Medallion.Threading.IDistributedSynchronizationHandle.HandleLostToken') | + +| Methods | | +| :--- | :--- | +| [DisposeAsync()](ZooKeeperDistributedSemaphoreHandle.DisposeAsync().md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphoreHandle.DisposeAsync()') | Releases the semaphore | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.AddAccessControl.tEJOZTy+rziKjj9R59jrIQ.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.AddAccessControl.tEJOZTy+rziKjj9R59jrIQ.md new file mode 100644 index 00000000..a0d74dae --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.AddAccessControl.tEJOZTy+rziKjj9R59jrIQ.md @@ -0,0 +1,29 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') + +## ZooKeeperDistributedSynchronizationOptionsBuilder.AddAccessControl(string, string, int) Method + +Configures the access control list (ACL) for any created ZooKeeper nodes. Each call to this method adds another entry to the access control +list. See https://zookeeper.apache.org/doc/r3.5.4-beta/zookeeperProgrammers.html for more information on ZooKeeper ACLs. + +If no ACL entries are specified, the ACL used will be a singleton list that grants all permissions to (world, anyone). + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder AddAccessControl(string scheme, string id, int permissionFlags); +``` +#### Parameters + + + +`scheme` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`id` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`permissionFlags` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +#### Returns +[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.AddAuthInfo.JC63oXMe1MWcEJ2k3bfJ0g.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.AddAuthInfo.JC63oXMe1MWcEJ2k3bfJ0g.md new file mode 100644 index 00000000..b215fac4 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.AddAuthInfo.JC63oXMe1MWcEJ2k3bfJ0g.md @@ -0,0 +1,26 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') + +## ZooKeeperDistributedSynchronizationOptionsBuilder.AddAuthInfo(string, IReadOnlyList) Method + +Specifies authentication info to be added to the Zookeeper connection with [org.apache.zookeeper.ZooKeeper.addAuthInfo(System.String,System.Byte[])](https://docs.microsoft.com/en-us/dotnet/api/org.apache.zookeeper.ZooKeeper.addAuthInfo#org_apache_zookeeper_ZooKeeper_addAuthInfo_System_String,System_Byte[]_ 'org.apache.zookeeper.ZooKeeper.addAuthInfo(System.String,System.Byte[])'). Each call +to this method adds another entry to the list of auth info. See https://zookeeper.apache.org/doc/r3.5.4-beta/zookeeperProgrammers.html for more +information on ZooKeeper auth. + +By default, no auth info is added. + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder AddAuthInfo(string scheme, System.Collections.Generic.IReadOnlyList auth); +``` +#### Parameters + + + +`scheme` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`auth` [System.Collections.Generic.IReadOnlyList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyList-1 'System.Collections.Generic.IReadOnlyList`1')[System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyList-1 'System.Collections.Generic.IReadOnlyList`1') + +#### Returns +[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.ConnectTimeout.I/ihabf4bAq6D8+832gAKA.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.ConnectTimeout.I/ihabf4bAq6D8+832gAKA.md new file mode 100644 index 00000000..e35cc243 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.ConnectTimeout.I/ihabf4bAq6D8+832gAKA.md @@ -0,0 +1,20 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') + +## ZooKeeperDistributedSynchronizationOptionsBuilder.ConnectTimeout(TimeSpan) Method + +Configures how long to wait to establish a connection to ZooKeeper before failing with a [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException'). + +Defaults to 15s. + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder ConnectTimeout(System.TimeSpan connectTimeout); +``` +#### Parameters + + + +`connectTimeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout.a4s4suCBjQ12y3wfkImgaw.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout.a4s4suCBjQ12y3wfkImgaw.md new file mode 100644 index 00000000..b6dd2fe9 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout.a4s4suCBjQ12y3wfkImgaw.md @@ -0,0 +1,22 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') + +## ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout(TimeSpan) Method + +Configures the [sessionTimeout](ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout.a4s4suCBjQ12y3wfkImgaw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout(System.TimeSpan).sessionTimeout 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout(System.TimeSpan).sessionTimeout') for connections to ZooKeeper. Because the underlying ZooKeeper client periodically renews +the session, this value generally will not impact behavior. Lower values mean that locks will be released more quickly following a crash +of the lock-holding process, but also increase the risk that transient connection issues will result in a dropped lock. + +Defaults to 20s. + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder SessionTimeout(System.TimeSpan sessionTimeout); +``` +#### Parameters + + + +`sessionTimeout` [System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + +#### Returns +[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.md new file mode 100644 index 00000000..cdbdb415 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationOptionsBuilder.md @@ -0,0 +1,19 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperDistributedSynchronizationOptionsBuilder Class + +Options for configuring ZooKeeper-based synchronization primitives + +```csharp +public sealed class ZooKeeperDistributedSynchronizationOptionsBuilder +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 ZooKeeperDistributedSynchronizationOptionsBuilder + +| Methods | | +| :--- | :--- | +| [AddAccessControl(string, string, int)](ZooKeeperDistributedSynchronizationOptionsBuilder.AddAccessControl.tEJOZTy+rziKjj9R59jrIQ.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder.AddAccessControl(string, string, int)') | Configures the access control list (ACL) for any created ZooKeeper nodes. Each call to this method adds another entry to the access control list. See https://zookeeper.apache.org/doc/r3.5.4-beta/zookeeperProgrammers.html for more information on ZooKeeper ACLs. If no ACL entries are specified, the ACL used will be a singleton list that grants all permissions to (world, anyone). | +| [AddAuthInfo(string, IReadOnlyList<byte>)](ZooKeeperDistributedSynchronizationOptionsBuilder.AddAuthInfo.JC63oXMe1MWcEJ2k3bfJ0g.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder.AddAuthInfo(string, System.Collections.Generic.IReadOnlyList)') | Specifies authentication info to be added to the Zookeeper connection with [org.apache.zookeeper.ZooKeeper.addAuthInfo(System.String,System.Byte[])](https://docs.microsoft.com/en-us/dotnet/api/org.apache.zookeeper.ZooKeeper.addAuthInfo#org_apache_zookeeper_ZooKeeper_addAuthInfo_System_String,System_Byte[]_ 'org.apache.zookeeper.ZooKeeper.addAuthInfo(System.String,System.Byte[])'). Each call to this method adds another entry to the list of auth info. See https://zookeeper.apache.org/doc/r3.5.4-beta/zookeeperProgrammers.html for more information on ZooKeeper auth. By default, no auth info is added. | +| [ConnectTimeout(TimeSpan)](ZooKeeperDistributedSynchronizationOptionsBuilder.ConnectTimeout.I/ihabf4bAq6D8+832gAKA.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder.ConnectTimeout(System.TimeSpan)') | Configures how long to wait to establish a connection to ZooKeeper before failing with a [System.TimeoutException](https://docs.microsoft.com/en-us/dotnet/api/System.TimeoutException 'System.TimeoutException'). Defaults to 15s. | +| [SessionTimeout(TimeSpan)](ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout.a4s4suCBjQ12y3wfkImgaw.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout(System.TimeSpan)') | Configures the [sessionTimeout](ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout.a4s4suCBjQ12y3wfkImgaw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout(System.TimeSpan).sessionTimeout 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder.SessionTimeout(System.TimeSpan).sessionTimeout') for connections to ZooKeeper. Because the underlying ZooKeeper client periodically renews the session, this value generally will not impact behavior. Lower values mean that locks will be released more quickly following a crash of the lock-holding process, but also increase the risk that transient connection issues will result in a dropped lock. Defaults to 20s. | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md new file mode 100644 index 00000000..71b45537 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md @@ -0,0 +1,24 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationProvider](ZooKeeperDistributedSynchronizationProvider.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider') + +## ZooKeeperDistributedSynchronizationProvider(ZooKeeperPath, string, Action) Constructor + +Constructs a provider which uses [connectionString](ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, System.Action).connectionString') and [options](ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, System.Action).options'). Lock and semaphore nodes will be created +in [directoryPath](ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, System.Action).directoryPath'). + +```csharp +public ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath directoryPath, string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`directoryPath` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider..ctor.vy3yiMkyxWODnX4fLuAvkQ.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider..ctor.vy3yiMkyxWODnX4fLuAvkQ.md new file mode 100644 index 00000000..a8f64667 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider..ctor.vy3yiMkyxWODnX4fLuAvkQ.md @@ -0,0 +1,20 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationProvider](ZooKeeperDistributedSynchronizationProvider.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider') + +## ZooKeeperDistributedSynchronizationProvider(string, Action) Constructor + +Constructs a provider which uses [connectionString](ZooKeeperDistributedSynchronizationProvider..ctor.vy3yiMkyxWODnX4fLuAvkQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](ZooKeeperDistributedSynchronizationProvider..ctor.vy3yiMkyxWODnX4fLuAvkQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string, System.Action).options'). Lock and semaphore nodes will be created +in the root directory '/'. + +```csharp +public ZooKeeperDistributedSynchronizationProvider(string connectionString, System.Action? options=null); +``` +#### Parameters + + + +`connectionString` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`options` [System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[ZooKeeperDistributedSynchronizationOptionsBuilder](ZooKeeperDistributedSynchronizationOptionsBuilder.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateLock.F3xNt1712Th0LXGKBIudtA.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateLock.F3xNt1712Th0LXGKBIudtA.md new file mode 100644 index 00000000..46893e25 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateLock.F3xNt1712Th0LXGKBIudtA.md @@ -0,0 +1,20 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationProvider](ZooKeeperDistributedSynchronizationProvider.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider') + +## ZooKeeperDistributedSynchronizationProvider.CreateLock(string) Method + +Creates a [ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') using the given [name](ZooKeeperDistributedSynchronizationProvider.CreateLock.F3xNt1712Th0LXGKBIudtA.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateLock(string).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateLock(string).name'). + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock CreateLock(string name); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +Implements [CreateLock(string)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.CreateLock.lcl3dolUp9eZyeUENeHU9w.md 'Medallion.Threading.IDistributedLockProvider.CreateLock(System.String)') + +#### Returns +[ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock.bhwTUdcK1w3Lu0/2I6g3IA.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock.bhwTUdcK1w3Lu0/2I6g3IA.md new file mode 100644 index 00000000..bf162767 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock.bhwTUdcK1w3Lu0/2I6g3IA.md @@ -0,0 +1,20 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationProvider](ZooKeeperDistributedSynchronizationProvider.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider') + +## ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock(string) Method + +Creates a [ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') using the given [name](ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock.bhwTUdcK1w3Lu0/2I6g3IA.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock(string).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock(string).name'). + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock CreateReaderWriterLock(string name); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +Implements [CreateReaderWriterLock(string)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.CreateReaderWriterLock.BJyxJJllIyIqdlfqBHLDTA.md 'Medallion.Threading.IDistributedReaderWriterLockProvider.CreateReaderWriterLock(System.String)') + +#### Returns +[ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateSemaphore/8MW9887Y7GcGqa+mUYdzQ.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateSemaphore/8MW9887Y7GcGqa+mUYdzQ.md new file mode 100644 index 00000000..1e684651 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.CreateSemaphore/8MW9887Y7GcGqa+mUYdzQ.md @@ -0,0 +1,24 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperDistributedSynchronizationProvider](ZooKeeperDistributedSynchronizationProvider.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider') + +## ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string, int) Method + +Creates a [ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') using the given [name](ZooKeeperDistributedSynchronizationProvider.CreateSemaphore./8MW9887Y7GcGqa+mUYdzQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string,int).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string, int).name') and [maxCount](ZooKeeperDistributedSynchronizationProvider.CreateSemaphore./8MW9887Y7GcGqa+mUYdzQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string,int).maxCount 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string, int).maxCount'). + +```csharp +public Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore CreateSemaphore(string name, int maxCount); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +`maxCount` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +Implements [CreateSemaphore(string, int)](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.CreateSemaphore.AA9FahTKczyqDQd0GIAGzQ.md 'Medallion.Threading.IDistributedSemaphoreProvider.CreateSemaphore(System.String,System.Int32)') + +#### Returns +[ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.md new file mode 100644 index 00000000..3cb6b372 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperDistributedSynchronizationProvider.md @@ -0,0 +1,30 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperDistributedSynchronizationProvider Class + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider') for [ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock'), +[IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider') for [ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock'), +and [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') for [ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore'). + +```csharp +public sealed class ZooKeeperDistributedSynchronizationProvider : +Medallion.Threading.IDistributedLockProvider, +Medallion.Threading.IDistributedReaderWriterLockProvider, +Medallion.Threading.IDistributedSemaphoreProvider +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 ZooKeeperDistributedSynchronizationProvider + +Implements [IDistributedLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedLockProvider.md 'Medallion.Threading.IDistributedLockProvider'), [IDistributedReaderWriterLockProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedReaderWriterLockProvider.md 'Medallion.Threading.IDistributedReaderWriterLockProvider'), [IDistributedSemaphoreProvider](https://github.com/madelson/DistributedLock/tree/default-documentation/docs/api/DistributedLock.Core/IDistributedSemaphoreProvider.md 'Medallion.Threading.IDistributedSemaphoreProvider') + +| Constructors | | +| :--- | :--- | +| [ZooKeeperDistributedSynchronizationProvider(ZooKeeperPath, string, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, System.Action)') | Constructs a provider which uses [connectionString](ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, System.Action).connectionString') and [options](ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, System.Action).options'). Lock and semaphore nodes will be created in [directoryPath](ZooKeeperDistributedSynchronizationProvider..ctor.cwicK93j0K7ho3vCLOhbSw.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath,string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).directoryPath 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(Medallion.Threading.ZooKeeper.ZooKeeperPath, string, System.Action).directoryPath'). | +| [ZooKeeperDistributedSynchronizationProvider(string, Action<ZooKeeperDistributedSynchronizationOptionsBuilder>)](ZooKeeperDistributedSynchronizationProvider..ctor.vy3yiMkyxWODnX4fLuAvkQ.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string, System.Action)') | Constructs a provider which uses [connectionString](ZooKeeperDistributedSynchronizationProvider..ctor.vy3yiMkyxWODnX4fLuAvkQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).connectionString 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string, System.Action).connectionString') and [options](ZooKeeperDistributedSynchronizationProvider..ctor.vy3yiMkyxWODnX4fLuAvkQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string,System.Action_Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationOptionsBuilder_).options 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.ZooKeeperDistributedSynchronizationProvider(string, System.Action).options'). Lock and semaphore nodes will be created in the root directory '/'. | + +| Methods | | +| :--- | :--- | +| [CreateLock(string)](ZooKeeperDistributedSynchronizationProvider.CreateLock.F3xNt1712Th0LXGKBIudtA.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateLock(string)') | Creates a [ZooKeeperDistributedLock](ZooKeeperDistributedLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedLock') using the given [name](ZooKeeperDistributedSynchronizationProvider.CreateLock.F3xNt1712Th0LXGKBIudtA.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateLock(string).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateLock(string).name'). | +| [CreateReaderWriterLock(string)](ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock.bhwTUdcK1w3Lu0/2I6g3IA.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock(string)') | Creates a [ZooKeeperDistributedReaderWriterLock](ZooKeeperDistributedReaderWriterLock.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedReaderWriterLock') using the given [name](ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock.bhwTUdcK1w3Lu0/2I6g3IA.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock(string).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateReaderWriterLock(string).name'). | +| [CreateSemaphore(string, int)](ZooKeeperDistributedSynchronizationProvider.CreateSemaphore./8MW9887Y7GcGqa+mUYdzQ.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string, int)') | Creates a [ZooKeeperDistributedSemaphore](ZooKeeperDistributedSemaphore.md 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSemaphore') using the given [name](ZooKeeperDistributedSynchronizationProvider.CreateSemaphore./8MW9887Y7GcGqa+mUYdzQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string,int).name 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string, int).name') and [maxCount](ZooKeeperDistributedSynchronizationProvider.CreateSemaphore./8MW9887Y7GcGqa+mUYdzQ.md#Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string,int).maxCount 'Medallion.Threading.ZooKeeper.ZooKeeperDistributedSynchronizationProvider.CreateSemaphore(string, int).maxCount'). | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath..ctor.ZsFWJSkmkGB08MbVdjFPyw.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath..ctor.ZsFWJSkmkGB08MbVdjFPyw.md new file mode 100644 index 00000000..f842b495 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath..ctor.ZsFWJSkmkGB08MbVdjFPyw.md @@ -0,0 +1,15 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +## ZooKeeperPath(string) Constructor + +Constructs a new [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') based on the given [path](ZooKeeperPath..ctor.ZsFWJSkmkGB08MbVdjFPyw.md#Medallion.Threading.ZooKeeper.ZooKeeperPath.ZooKeeperPath(string).path 'Medallion.Threading.ZooKeeper.ZooKeeperPath.ZooKeeperPath(string).path') string. + +```csharp +public ZooKeeperPath(string path); +``` +#### Parameters + + + +`path` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.Equals.J5/wqdQppznvVwiU3kq31Q.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.Equals.J5/wqdQppznvVwiU3kq31Q.md new file mode 100644 index 00000000..43515515 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.Equals.J5/wqdQppznvVwiU3kq31Q.md @@ -0,0 +1,18 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +## ZooKeeperPath.Equals(object) Method + +Implements equality based on the path string + +```csharp +public override bool Equals(object obj); +``` +#### Parameters + + + +`obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.Equals.VVXwkPSRrVJ19AkTFg5+xw.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.Equals.VVXwkPSRrVJ19AkTFg5+xw.md new file mode 100644 index 00000000..c87be9a0 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.Equals.VVXwkPSRrVJ19AkTFg5+xw.md @@ -0,0 +1,18 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +## ZooKeeperPath.Equals(ZooKeeperPath) Method + +Implements equality based on the path string + +```csharp +public bool Equals(Medallion.Threading.ZooKeeper.ZooKeeperPath that); +``` +#### Parameters + + + +`that` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.GetHashCode().md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.GetHashCode().md new file mode 100644 index 00000000..0b990ff0 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.GetHashCode().md @@ -0,0 +1,13 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +## ZooKeeperPath.GetHashCode() Method + +Implements hashing based on the path string + +```csharp +public override int GetHashCode(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.ToString().md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.ToString().md new file mode 100644 index 00000000..2bffda1f --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.ToString().md @@ -0,0 +1,13 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +## ZooKeeperPath.ToString() Method + +Returns the path value as a string + +```csharp +public override string ToString(); +``` + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.md new file mode 100644 index 00000000..1f82a978 --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.md @@ -0,0 +1,30 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper') + +## ZooKeeperPath Struct + +Represents a path to a ZooKeeper node. The constructor validates that the input is a valid path. +Call [ToString()](ZooKeeperPath.ToString().md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.ToString()') to get the path value. + +```csharp +public readonly struct ZooKeeperPath : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') + +| Constructors | | +| :--- | :--- | +| [ZooKeeperPath(string)](ZooKeeperPath..ctor.ZsFWJSkmkGB08MbVdjFPyw.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.ZooKeeperPath(string)') | Constructs a new [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') based on the given [path](ZooKeeperPath..ctor.ZsFWJSkmkGB08MbVdjFPyw.md#Medallion.Threading.ZooKeeper.ZooKeeperPath.ZooKeeperPath(string).path 'Medallion.Threading.ZooKeeper.ZooKeeperPath.ZooKeeperPath(string).path') string. | + +| Methods | | +| :--- | :--- | +| [Equals(ZooKeeperPath)](ZooKeeperPath.Equals.VVXwkPSRrVJ19AkTFg5+xw.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.Equals(Medallion.Threading.ZooKeeper.ZooKeeperPath)') | Implements equality based on the path string | +| [Equals(object)](ZooKeeperPath.Equals.J5/wqdQppznvVwiU3kq31Q.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.Equals(object)') | Implements equality based on the path string | +| [GetHashCode()](ZooKeeperPath.GetHashCode().md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.GetHashCode()') | Implements hashing based on the path string | +| [ToString()](ZooKeeperPath.ToString().md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.ToString()') | Returns the path value as a string | + +| Operators | | +| :--- | :--- | +| [operator ==(ZooKeeperPath, ZooKeeperPath)](ZooKeeperPath.op_Equality.0Gh9Mk6h/aa6pYstqDJebg.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.op_Equality(Medallion.Threading.ZooKeeper.ZooKeeperPath, Medallion.Threading.ZooKeeper.ZooKeeperPath)') | Implements equality based on the path string | +| [operator !=(ZooKeeperPath, ZooKeeperPath)](ZooKeeperPath.op_Inequality.hyYJhclLXAbXbwzJmpT2JA.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath.op_Inequality(Medallion.Threading.ZooKeeper.ZooKeeperPath, Medallion.Threading.ZooKeeper.ZooKeeperPath)') | Implements inequality based on the path string | diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.op_Equality.0Gh9Mk6h/aa6pYstqDJebg.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.op_Equality.0Gh9Mk6h/aa6pYstqDJebg.md new file mode 100644 index 00000000..921391dd --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.op_Equality.0Gh9Mk6h/aa6pYstqDJebg.md @@ -0,0 +1,22 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +## ZooKeeperPath.operator ==(ZooKeeperPath, ZooKeeperPath) Operator + +Implements equality based on the path string + +```csharp +public static bool operator ==(Medallion.Threading.ZooKeeper.ZooKeeperPath @this, Medallion.Threading.ZooKeeper.ZooKeeperPath that); +``` +#### Parameters + + + +`this` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`that` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.op_Inequality.hyYJhclLXAbXbwzJmpT2JA.md b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.op_Inequality.hyYJhclLXAbXbwzJmpT2JA.md new file mode 100644 index 00000000..fc06c8da --- /dev/null +++ b/docs/api/DistributedLock.ZooKeeper/ZooKeeperPath.op_Inequality.hyYJhclLXAbXbwzJmpT2JA.md @@ -0,0 +1,22 @@ +#### [DistributedLock.ZooKeeper](README.md 'README') +### [Medallion.Threading.ZooKeeper](Medallion.Threading.ZooKeeper.md 'Medallion.Threading.ZooKeeper').[ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +## ZooKeeperPath.operator !=(ZooKeeperPath, ZooKeeperPath) Operator + +Implements inequality based on the path string + +```csharp +public static bool operator !=(Medallion.Threading.ZooKeeper.ZooKeeperPath @this, Medallion.Threading.ZooKeeper.ZooKeeperPath that); +``` +#### Parameters + + + +`this` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + + + +`that` [ZooKeeperPath](ZooKeeperPath.md 'Medallion.Threading.ZooKeeper.ZooKeeperPath') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file