Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to support net8.0 and Orleans 8.2 #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
dotnet-version: 8.x
- name: Build
run: dotnet build --configuration Release
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
dotnet-version: 8.x
- name: Build
run: dotnet build --configuration Release
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<!-- Common compile parameters -->
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion README.Nuget.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ TODO: These two abilities should be provided independently of each other. Unfort

Installation is performed via [NuGet.](https://www.nuget.org/packages/SignalR.Orleans/)

Packages with version `7.x.x` are compatible with Orleans `v7.x.x` and above. If you're still using an earlier version of Orleans, you will need to use earlier versions of the package.
Packages with version `8.x.x` are compatible with Orleans `v8.x.x` and above. If you're still using an earlier version of Orleans, you will need to use earlier versions of the package.

Package Manager:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TODO: These two abilities should be provided independently of each other. Unfort

Installation is performed via [NuGet.](https://www.nuget.org/packages/SignalR.Orleans/)

Packages with version `7.x.x` are compatible with Orleans `v7.x.x` and above. If you're still using an earlier version of Orleans, you will need to use earlier versions of the package.
Packages with version `8.x.x` are compatible with Orleans `v8.x.x` and above. If you're still using an earlier version of Orleans, you will need to use earlier versions of the package.

Package Manager:

Expand Down
7 changes: 4 additions & 3 deletions samples/Silo/Silo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Orleans.Server" Version="7.2.0" />
<PackageReference Include="Microsoft.Orleans.Streaming" Version="7.2.0" />
<PackageReference Include="Microsoft.Orleans.Server" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Streaming" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 4 additions & 7 deletions src/SignalR.Orleans/ServerDirectory/ServerDirectoryGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ public Task OnActivateAsync(CancellationToken cancellationToken)
_logger.LogInformation("Available servers {serverIds}",
string.Join(", ", _state.State.ServerHeartBeats?.Count > 0 ? string.Join(", ", _state.State.ServerHeartBeats) : "empty"));

_timerRegistry.RegisterTimer(
this.GrainContext,
ValidateAndCleanUp,
_state.State,
TimeSpan.FromSeconds(15),
TimeSpan.FromMinutes(SERVERDIRECTORY_CLEANUP_IN_MINUTES));
_timerRegistry.RegisterGrainTimer(this.GrainContext, ValidateAndCleanUp,
_state.State, new GrainTimerCreationOptions(TimeSpan.FromSeconds(15),
TimeSpan.FromMinutes(SERVERDIRECTORY_CLEANUP_IN_MINUTES)));

return Task.CompletedTask;
}
Expand All @@ -62,7 +59,7 @@ public async Task Unregister(Guid serverId)
await _state.WriteStateAsync();
}

private async Task ValidateAndCleanUp(object serverDirectory)
private async Task ValidateAndCleanUp(ServerDirectoryState serverDirectory, CancellationToken token)
{
var inactiveTime = DateTime.UtcNow.AddMinutes(-SERVERDIRECTORY_CLEANUP_IN_MINUTES);
var expiredHeartBeats = _state.State.ServerHeartBeats.Where(heartBeat => heartBeat.Value < inactiveTime).ToList();
Expand Down
5 changes: 3 additions & 2 deletions src/SignalR.Orleans/SignalR.Orleans.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
<ItemGroup>
<!-- see https://gist.github.com/tebeco/a6e0d9a3885a0a36e702795219bd4fe9 -->
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Orleans.Server" Version="7.2.0" />
<PackageReference Include="Microsoft.Orleans.Streaming" Version="7.2.0" />
<PackageReference Include="Microsoft.Orleans.Server" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Streaming" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 7 additions & 6 deletions test/SignalR.Orleans.Tests/SignalR.Orleans.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
<ItemGroup>
<!-- see https://gist.github.com/tebeco/a6e0d9a3885a0a36e702795219bd4fe9 -->
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.Orleans.Server" Version="7.2.0" />
<PackageReference Include="Microsoft.Orleans.Streaming" Version="7.2.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.Orleans.Server" Version="8.2.0" />
<PackageReference Include="Microsoft.Orleans.Streaming" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down