Merge pull request #19059 from JamesNK/jamesnk/remove-ix-net-dependency

Remove System.Interactive.Async dependency
pull/19786/head
Jan Tattermusch 5 years ago committed by GitHub
commit ede5a8e2d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 50
      src/csharp/Grpc.Core.Api/AsyncStreamReaderExtensions.cs
  2. 1
      src/csharp/Grpc.Core.Api/Grpc.Core.Api.csproj
  3. 22
      src/csharp/Grpc.Core.Api/IAsyncStreamReader.cs
  4. 3
      src/csharp/Grpc.Core/Grpc.Core.csproj
  5. 2
      src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs

@ -0,0 +1,50 @@
#region Copyright notice and license
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Grpc.Core
{
/// <summary>
/// Extension methods for <see cref="IAsyncStreamReader{T}"/>.
/// </summary>
public static class AsyncStreamReaderExtensions
{
/// <summary>
/// Advances the stream reader to the next element in the sequence, returning the result asynchronously.
/// </summary>
/// <typeparam name="T">The message type.</typeparam>
/// <param name="streamReader">The stream reader.</param>
/// <returns>
/// Task containing the result of the operation: true if the reader was successfully advanced
/// to the next element; false if the reader has passed the end of the sequence.
/// </returns>
public static Task<bool> MoveNext<T>(this IAsyncStreamReader<T> streamReader)
where T : class
{
if (streamReader == null)
{
throw new ArgumentNullException(nameof(streamReader));
}
return streamReader.MoveNext(CancellationToken.None);
}
}
}

@ -23,7 +23,6 @@
<Import Project="..\Grpc.Core\SourceLink.csproj.include" />
<ItemGroup>
<PackageReference Include="System.Interactive.Async" Version="3.2.0" />
<PackageReference Include="System.Memory" Version="4.5.3" />
</ItemGroup>

@ -1,4 +1,4 @@
#region Copyright notice and license
#region Copyright notice and license
// Copyright 2015 gRPC authors.
//
@ -16,10 +16,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Grpc.Core
@ -50,7 +47,20 @@ namespace Grpc.Core
/// </para>
/// </summary>
/// <typeparam name="T">The message type.</typeparam>
public interface IAsyncStreamReader<T> : IAsyncEnumerator<T>
public interface IAsyncStreamReader<T>
{
/// <summary>
/// Gets the current element in the iteration.
/// </summary>
T Current { get; }
/// <summary>
/// Advances the reader to the next element in the sequence, returning the result asynchronously.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
/// <returns>
/// Task containing the result of the operation: true if the reader was successfully advanced
/// to the next element; false if the reader has passed the end of the sequence.</returns>
Task<bool> MoveNext(CancellationToken cancellationToken);
}
}

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="Common.csproj.include" />
@ -98,7 +98,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Interactive.Async" Version="3.2.0" />
<PackageReference Include="System.Memory" Version="4.5.3" />
</ItemGroup>

@ -1,4 +1,4 @@
#region Copyright notice and license
#region Copyright notice and license
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");

Loading…
Cancel
Save