Merge pull request #20549 from JamesNK/jamesnk/generic-variance

Add generic variance to reader and writer interfaces
pull/20591/head
Jan Tattermusch 5 years ago committed by GitHub
commit f92c283a5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/csharp/Grpc.Core.Api/IAsyncStreamReader.cs
  2. 4
      src/csharp/Grpc.Core.Api/IAsyncStreamWriter.cs
  3. 4
      src/csharp/Grpc.Core.Api/IClientStreamWriter.cs
  4. 4
      src/csharp/Grpc.Core.Api/IServerStreamWriter.cs

@ -47,7 +47,7 @@ namespace Grpc.Core
/// </para>
/// </summary>
/// <typeparam name="T">The message type.</typeparam>
public interface IAsyncStreamReader<T>
public interface IAsyncStreamReader<out T>
{
/// <summary>
/// Gets the current element in the iteration.

@ -1,4 +1,4 @@
#region Copyright notice and license
#region Copyright notice and license
// Copyright 2015 gRPC authors.
//
@ -28,7 +28,7 @@ namespace Grpc.Core
/// A writable stream of messages.
/// </summary>
/// <typeparam name="T">The message type.</typeparam>
public interface IAsyncStreamWriter<T>
public interface IAsyncStreamWriter<in T>
{
/// <summary>
/// Writes a single asynchronously. Only one write can be pending at a time.

@ -1,4 +1,4 @@
#region Copyright notice and license
#region Copyright notice and license
// Copyright 2015 gRPC authors.
//
@ -28,7 +28,7 @@ namespace Grpc.Core
/// Client-side writable stream of messages with Close capability.
/// </summary>
/// <typeparam name="T">The message type.</typeparam>
public interface IClientStreamWriter<T> : IAsyncStreamWriter<T>
public interface IClientStreamWriter<in T> : IAsyncStreamWriter<T>
{
/// <summary>
/// Completes/closes the stream. Can only be called once there is no pending write. No writes should follow calling this.

@ -1,4 +1,4 @@
#region Copyright notice and license
#region Copyright notice and license
// Copyright 2015 gRPC authors.
//
@ -27,7 +27,7 @@ namespace Grpc.Core
/// <summary>
/// A writable stream of messages that is used in server-side handlers.
/// </summary>
public interface IServerStreamWriter<T> : IAsyncStreamWriter<T>
public interface IServerStreamWriter<in T> : IAsyncStreamWriter<T>
{
// TODO(jtattermusch): consider just using IAsyncStreamWriter instead of this interface.
}

Loading…
Cancel
Save