Skip to content

Commit

Permalink
Set target framework
Browse files Browse the repository at this point in the history
  • Loading branch information
sanych-sun committed Sep 4, 2024
1 parent 756b3aa commit 37f9e95
Show file tree
Hide file tree
Showing 23 changed files with 19 additions and 37 deletions.
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Project>
<PropertyGroup>
<Version>0.4.0</Version>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Authors>Oleksandr Poliakov</Authors>
<PackageTags>RabbitMQ;Messaging</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Description>An experimental low-level RabbitMQ client for .Net with number of high-level APIs</Description>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>RabbitMQ.Next</RootNamespace>
<PackageId>RabbitMQ.Next.Abstractions</PackageId>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>RabbitMQ.Next.Consumer</RootNamespace>
<PackageId>RabbitMQ.Next.Consumer.Abstractions</PackageId>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/RabbitMQ.Next.Consumer/RabbitMQ.Next.Consumer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.Consumer</PackageId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>RabbitMQ.Next.Publisher</RootNamespace>
<PackageId>RabbitMQ.Next.Publisher.Abstractions</PackageId>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.Publisher.Attributes</PackageId>
</PropertyGroup>

Expand Down
1 change: 0 additions & 1 deletion src/RabbitMQ.Next.Publisher/RabbitMQ.Next.Publisher.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.Publisher</PackageId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.Serialization.Dynamic</PackageId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.Serialization.MessagePack</PackageId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.Serialization.NewtonsoftJson</PackageId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.Serialization.PlainText</PackageId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.Serialization.SystemJson</PackageId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.TopologyBuilder.Abstractions</PackageId>
<RootNamespace>RabbitMQ.Next.TopologyBuilder</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>RabbitMQ.Next.TopologyBuilder</PackageId>
</PropertyGroup>

Expand Down
17 changes: 9 additions & 8 deletions src/RabbitMQ.Next/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ private void SendLoop()
{
var heartbeatMemory = new MemoryAccessor(ProtocolConstants.HeartbeatFrame);
var socketChannel = this.socketSender.Reader;

do
{
while (socketChannel.TryRead(out var memory))
Expand All @@ -146,19 +147,19 @@ private void SendLoop()
}
}

var waitResult = socketChannel.WaitToReadAsync().Wait(this.connectionDetails.HeartbeatInterval);
if (waitResult.IsCompleted)
if (socketChannel.WaitToReadAsync().Wait(this.connectionDetails.HeartbeatInterval, out var canRead))
{
if (waitResult.Result)
if (!canRead)
{
continue;
return;
}

break;
}
else
{
// wait long enough and nothing was sent, need to send heartbeat frame
this.socket.Send(heartbeatMemory);
}

// wait long enough and nothing was sent, need to send heartbeat frame
this.socket.Send(heartbeatMemory);
} while (true);
}

Expand Down
7 changes: 1 addition & 6 deletions src/RabbitMQ.Next/RabbitMQ.Next.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<PackageId>RabbitMQ.Next</PackageId>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="6.0.*" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="7.0.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\RabbitMQ.Next.Abstractions\RabbitMQ.Next.Abstractions.csproj" />
</ItemGroup>
Expand Down
11 changes: 7 additions & 4 deletions src/RabbitMQ.Next/Tasks/TaskExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ namespace RabbitMQ.Next.Tasks;

public static class TaskExtensions
{
public static (bool IsCompleted, T Result) Wait<T>(this ValueTask<T> valueTask, TimeSpan? timeout)
public static bool Wait<T>(this ValueTask<T> valueTask, TimeSpan? timeout, out T result)
{
if (valueTask.IsCompleted)
{
return (true, valueTask.Result);
result = valueTask.Result;
return true;
}

var task = valueTask.AsTask();
Expand All @@ -21,9 +22,11 @@ public static (bool IsCompleted, T Result) Wait<T>(this ValueTask<T> valueTask,

if (task.Wait(timeoutMs))
{
return (true, task.Result);
result = task.Result;
return true;
}

return (false, default);
result = default;
return false;
}
}
1 change: 0 additions & 1 deletion tests/RabbitMQ.Next.Tests/RabbitMQ.Next.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down

0 comments on commit 37f9e95

Please sign in to comment.