-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Hock
committed
Nov 15, 2024
1 parent
bbf059f
commit dcefc74
Showing
48 changed files
with
2,185 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- releases/* | ||
tags: | ||
- releases/* | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build ${{ matrix.display-name }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
configuration: ['debug', 'release'] | ||
include: | ||
- configuration: 'debug' | ||
display-name: 'Debug' | ||
- configuration: 'release' | ||
display-name: 'Release' | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 9.0.x | ||
|
||
- name: Build | ||
run: dotnet build --configuration ${{ matrix.configuration }} | ||
|
||
test: | ||
name: Test ${{ matrix.display-name }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dotnet-version: ['8.0', '9.0'] | ||
include: | ||
- dotnet-version: '8.0' | ||
display-name: '.NET 8.0' | ||
framework: 'net8' | ||
prefix: 'net8' | ||
install-version: '8.0.x' | ||
- dotnet-version: '9.0' | ||
display-name: '.NET 9.0' | ||
framework: 'net9' | ||
prefix: 'net9' | ||
install-version: '9.0.x' | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Setup ${{ matrix.display-name }} | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ matrix.install-version }} | ||
- name: Setup .NET 9.0 | ||
uses: actions/setup-dotnet@v1 | ||
if: ${{ matrix.install-version != '9.0.x' }} | ||
with: | ||
dotnet-version: 9.0.x | ||
|
||
- name: Test | ||
id: tests | ||
continue-on-error: true # proceed if tests fail to allow for the report generation in master or next step failure in PR | ||
run: | | ||
dotnet test \ | ||
--framework ${{ matrix.framework }} \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Solution> | ||
<Properties Name="Visual Studio"> | ||
<Property Name="OpenWith" Value="17" /> | ||
</Properties> | ||
<Folder Name="/.Settings/"> | ||
<File Path=".editorconfig" /> | ||
<File Path=".gitignore" /> | ||
<File Path="Directory.Build.props" /> | ||
<File Path="Directory.Build.targets" /> | ||
<File Path="Directory.Packages.props" /> | ||
<File Path="global.json" /> | ||
<File Path="NuGet.config" /> | ||
<File Path=".gitattributes" /> | ||
</Folder> | ||
<Project Path="src\AdHoc.Locking.Abstraction\AdHoc.Locking.Abstraction.csproj" /> | ||
<Project Path="src\AdHoc.Locking.Extensions.DependencyInjection\AdHoc.Locking.Extensions.DependencyInjection.csproj" /> | ||
<Project Path="src\AdHoc.Locking\AdHoc.Locking.csproj" /> | ||
<Project Path="test\AdHoc.Locking.Test\AdHoc.Locking.Test.csproj" /> | ||
<Folder Name="/test/"> | ||
<Project Path="..\..\..\..\..\..\..\..\AdHoc\AdHoc.Locking\test\AdHoc.Locking.AtomicFileLock\AdHoc.Locking.AtomicFileLock.csproj" /> | ||
<Project Path="..\..\..\..\..\..\..\..\AdHoc\AdHoc.Locking\test\AdHoc.Locking.Test\AdHoc.Locking.Test.csproj" /> | ||
<Project Path="test\AdHoc.Locking.AtomicFileLock\AdHoc.Locking.AtomicFileLock.csproj" /> | ||
</Folder> | ||
<Project Path="..\..\..\..\..\..\..\..\AdHoc\AdHoc.Locking\src\AdHoc.Locking.Abstraction\AdHoc.Locking.Abstraction.csproj" /> | ||
<Project Path="..\..\..\..\..\..\..\..\AdHoc\AdHoc.Locking\src\AdHoc.Locking.Extensions.DependencyInjection\AdHoc.Locking.Extensions.DependencyInjection.csproj" /> | ||
<Project Path="..\..\..\..\..\..\..\..\AdHoc\AdHoc.Locking\src\AdHoc.Locking\AdHoc.Locking.csproj" /> | ||
</Solution> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Label="Microsoft"> | ||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" /> | ||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" /> | ||
</ItemGroup> | ||
<ItemGroup Label="Test"> | ||
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" /> | ||
<PackageVersion Include="FluentAssertions" Version="6.12.2" /> | ||
<PackageVersion Include="Testcontainers" Version="4.0.0" /> | ||
<PackageVersion Include="coverlet.collector" Version="6.0.2" /> | ||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" /> | ||
<PackageVersion Include="xunit" Version="2.9.2" /> | ||
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" /> | ||
</ItemGroup> | ||
<ItemGroup Label="Fody"> | ||
<PackageVersion Include="ConfigureAwait.Fody" Version="[3.3.2,]" /> | ||
<PackageVersion Include="Fody" Version="[6.8.1,]" /> | ||
<PackageVersion Include="ConfigureAwait.Fody" Version="3.3.2" /> | ||
<PackageVersion Include="Fody" Version="6.8.2" /> | ||
</ItemGroup> | ||
<ItemGroup Label="Analyzer"> | ||
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="SourceLinkProperties"> | ||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" /> | ||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
</Project> |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
src/AdHoc.Locking.Abstraction/AdHoc.Locking.Abstraction.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Version>0.1.0-alpha</Version> | ||
</PropertyGroup> | ||
|
||
</Project> |
14 changes: 14 additions & 0 deletions
14
src/AdHoc.Locking.Abstraction/Atomic/Distributed/IDistributedAtomicLock.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright AdHoc Authors | ||
// SPDX-License-Identifier: MIT | ||
|
||
namespace AdHoc.Locking.Abstraction; | ||
public interface IDistributedAtomicLock | ||
: IAtomicLock, | ||
IDistributedLock<IDistributedAtomicLocking> | ||
{ | ||
ILocking ILock.Create() => | ||
((ILock<IDistributedAtomicLocking>)this).Create(); | ||
|
||
IAtomicLocking ILock<IAtomicLocking>.Create() => | ||
((ILock<IDistributedAtomicLocking>)this).Create(); | ||
} |
13 changes: 13 additions & 0 deletions
13
src/AdHoc.Locking.Abstraction/Atomic/Distributed/IDistributedAtomicLockProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright AdHoc Authors | ||
// SPDX-License-Identifier: MIT | ||
|
||
namespace AdHoc.Locking.Abstraction; | ||
public interface IDistributedAtomicLockProvider | ||
: IAtomicLockProvider, | ||
IDistributedLockProvider<IDistributedAtomicLock> | ||
{ | ||
ILock ILockProvider.GetLock(string name) => | ||
((ILockProvider<IDistributedAtomicLock>)this).GetLock(name); | ||
IAtomicLock ILockProvider<IAtomicLock>.GetLock(string name) => | ||
((ILockProvider<IDistributedAtomicLock>)this).GetLock(name); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/AdHoc.Locking.Abstraction/Atomic/Distributed/IDistributedAtomicLocking.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright AdHoc Authors | ||
// SPDX-License-Identifier: MIT | ||
|
||
namespace AdHoc.Locking.Abstraction; | ||
|
||
public interface IDistributedAtomicLocking | ||
: IAtomicLocking, | ||
IDistributedLocking | ||
{ | ||
ValueTask<bool> IsAcquiredAsync(CancellationToken cancellationToken); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace AdHoc.Locking.Abstraction; | ||
public interface IAtomicLock | ||
: ILock<IAtomicLocking>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace AdHoc.Locking.Abstraction; | ||
public interface IAtomicLockProvider | ||
: ILockProvider<IAtomicLock>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace AdHoc.Locking.Abstraction; | ||
public interface IAtomicLocking | ||
: ILocking | ||
{ | ||
bool IsAcquired { get; } | ||
} |
24 changes: 24 additions & 0 deletions
24
src/AdHoc.Locking.Abstraction/Distributed/IDistributedLock.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright AdHoc Authors | ||
// SPDX-License-Identifier: MIT | ||
|
||
using System.ComponentModel; | ||
|
||
namespace AdHoc.Locking.Abstraction; | ||
public interface IDistributedLock | ||
: ILock | ||
{ | ||
IDistributedLocking Create(string owner); | ||
} | ||
|
||
|
||
[EditorBrowsable(EditorBrowsableState.Advanced)] | ||
public interface IDistributedLock<TLocking> | ||
: IDistributedLock, | ||
ILock<TLocking> | ||
where TLocking : IDistributedLocking | ||
{ | ||
new TLocking Create(string owner); | ||
|
||
IDistributedLocking IDistributedLock.Create(string owner) => | ||
Create(owner); | ||
} |
30 changes: 30 additions & 0 deletions
30
src/AdHoc.Locking.Abstraction/Distributed/IDistributedLockProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright AdHoc Authors | ||
// SPDX-License-Identifier: MIT | ||
|
||
using System.ComponentModel; | ||
|
||
namespace AdHoc.Locking.Abstraction; | ||
public interface IDistributedLockProvider | ||
: ILockProvider | ||
{ | ||
new IDistributedLock GetLock(string name); | ||
|
||
ILock ILockProvider.GetLock(string name) => | ||
GetLock(name); | ||
|
||
|
||
void SetExpiryInterval(string? name, TimeSpan expiryInterval); | ||
} | ||
|
||
|
||
[EditorBrowsable(EditorBrowsableState.Advanced)] | ||
public interface IDistributedLockProvider<TLock> | ||
: IDistributedLockProvider, | ||
ILockProvider<TLock> | ||
where TLock : IDistributedLock | ||
{ | ||
IDistributedLock IDistributedLockProvider.GetLock(string name) => | ||
((ILockProvider<TLock>)this).GetLock(name); | ||
ILock ILockProvider.GetLock(string name) => | ||
((ILockProvider<TLock>)this).GetLock(name); | ||
} |
Oops, something went wrong.