Make ready for 0.9.0
diff --git a/src/DotPulsar/DotPulsar.csproj b/src/DotPulsar/DotPulsar.csproj
index e95f990..f8554b8 100644
--- a/src/DotPulsar/DotPulsar.csproj
+++ b/src/DotPulsar/DotPulsar.csproj
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
- <Version>0.8.4</Version>
+ <Version>0.9.0</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<FileVersion>$(Version)</FileVersion>
<Authors>DanskeCommodities;dblank</Authors>
@@ -11,7 +11,7 @@
<Title>DotPulsar</Title>
<PackageTags>Apache;Pulsar</PackageTags>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
- <PackageReleaseNotes>Beta release - Revert support for proxies. Will be added again later</PackageReleaseNotes>
+ <PackageReleaseNotes>Beta release - Proxy support</PackageReleaseNotes>
<Description>.NET/C# client library for Apache Pulsar</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@@ -22,12 +22,12 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
- <PackageReference Include="protobuf-net" Version="2.4.4" />
- <PackageReference Include="System.IO.Pipelines" Version="4.7.1" />
+ <PackageReference Include="protobuf-net" Version="2.4.6" />
+ <PackageReference Include="System.IO.Pipelines" Version="4.7.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
- <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.0" />
+ <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.0" />
</ItemGroup>
diff --git a/src/DotPulsar/Internal/ConnectionPool.cs b/src/DotPulsar/Internal/ConnectionPool.cs
index c86cfc5..8f05343 100644
--- a/src/DotPulsar/Internal/ConnectionPool.cs
+++ b/src/DotPulsar/Internal/ConnectionPool.cs
@@ -36,7 +36,12 @@
private readonly CancellationTokenSource _cancellationTokenSource;
private readonly Task _closeInactiveConnections;
- public ConnectionPool(CommandConnect commandConnect, Uri serviceUrl, Connector connector, EncryptionPolicy encryptionPolicy, TimeSpan closeInactiveConnectionsInterval)
+ public ConnectionPool(
+ CommandConnect commandConnect,
+ Uri serviceUrl,
+ Connector connector,
+ EncryptionPolicy encryptionPolicy,
+ TimeSpan closeInactiveConnectionsInterval)
{
_lock = new AsyncLock();
_commandConnect = commandConnect;
@@ -51,6 +56,7 @@
public async ValueTask DisposeAsync()
{
_cancellationTokenSource.Cancel();
+
await _closeInactiveConnections.ConfigureAwait(false);
await _lock.DisposeAsync().ConfigureAwait(false);
@@ -152,9 +158,7 @@
var commandConnect = _commandConnect;
if (url.ProxyThroughServiceUrl)
- {
commandConnect = WithProxyToBroker(_commandConnect, url.Logical);
- }
var response = await connection.Send(commandConnect, cancellationToken).ConfigureAwait(false);
response.Expect(BaseCommand.Type.Connected);
@@ -215,7 +219,7 @@
}
}
- private class PulsarUrl: IEquatable<PulsarUrl>
+ private sealed class PulsarUrl : IEquatable<PulsarUrl>
{
public PulsarUrl(Uri physical, Uri logical)
{
@@ -223,33 +227,26 @@
Logical = logical;
ProxyThroughServiceUrl = physical != logical;
}
+
public Uri Physical { get; }
+
public Uri Logical { get; }
public bool ProxyThroughServiceUrl { get; }
public bool Equals(PulsarUrl? other)
{
- if (ReferenceEquals(null, other))
+ if (other is null)
return false;
if (ReferenceEquals(this, other))
return true;
+
return Physical.Equals(other.Physical) && Logical.Equals(other.Logical);
}
public override bool Equals(object? obj)
- {
- if (ReferenceEquals(null, obj))
- return false;
-
- if (ReferenceEquals(this, obj))
- return true;
-
- if (obj.GetType() != this.GetType())
- return false;
- return Equals((PulsarUrl) obj);
- }
+ => obj is PulsarUrl url && Equals(url);
public override int GetHashCode()
=> HashCode.Combine(Physical, Logical);
diff --git a/tests/DotPulsar.StressTests/DotPulsar.StressTests.csproj b/tests/DotPulsar.StressTests/DotPulsar.StressTests.csproj
index c92fa9d..fb077de 100644
--- a/tests/DotPulsar.StressTests/DotPulsar.StressTests.csproj
+++ b/tests/DotPulsar.StressTests/DotPulsar.StressTests.csproj
@@ -6,13 +6,13 @@
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit" Version="2.4.1" />
- <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
- <PackageReference Include="coverlet.collector" Version="1.2.1">
+ <PackageReference Include="coverlet.collector" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
diff --git a/tests/DotPulsar.Tests/DotPulsar.Tests.csproj b/tests/DotPulsar.Tests/DotPulsar.Tests.csproj
index 3eccafe..18430fb 100644
--- a/tests/DotPulsar.Tests/DotPulsar.Tests.csproj
+++ b/tests/DotPulsar.Tests/DotPulsar.Tests.csproj
@@ -6,13 +6,13 @@
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit" Version="2.4.1" />
- <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
- <PackageReference Include="coverlet.collector" Version="1.2.1">
+ <PackageReference Include="coverlet.collector" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>