Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 1 | #region Copyright notice and license |
| 2 | |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | // Copyright 2015-2016 gRPC authors. |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 4 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain a copy of the License at |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 8 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 10 | // |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 11 | // Unless required by applicable law or agreed to in writing, software |
| 12 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 16 | |
| 17 | #endregion |
| 18 | |
| 19 | using System.Threading.Tasks; |
| 20 | using Grpc.Core.Internal; |
| 21 | |
| 22 | namespace Grpc.Core |
| 23 | { |
| 24 | /// <summary> |
| 25 | /// Abstraction of client-side RPC invocation. |
| 26 | /// </summary> |
| 27 | /// <seealso cref="Calls"/> |
| 28 | public abstract class CallInvoker |
| 29 | { |
| 30 | /// <summary> |
| 31 | /// Invokes a simple remote call in a blocking fashion. |
| 32 | /// </summary> |
Jan Tattermusch | b455bcc | 2016-03-22 16:08:18 -0700 | [diff] [blame] | 33 | public abstract TResponse BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 34 | where TRequest : class |
| 35 | where TResponse : class; |
| 36 | |
| 37 | /// <summary> |
| 38 | /// Invokes a simple remote call asynchronously. |
| 39 | /// </summary> |
Jan Tattermusch | b455bcc | 2016-03-22 16:08:18 -0700 | [diff] [blame] | 40 | public abstract AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 41 | where TRequest : class |
| 42 | where TResponse : class; |
| 43 | |
| 44 | /// <summary> |
| 45 | /// Invokes a server streaming call asynchronously. |
| 46 | /// In server streaming scenario, client sends on request and server responds with a stream of responses. |
| 47 | /// </summary> |
Jan Tattermusch | b455bcc | 2016-03-22 16:08:18 -0700 | [diff] [blame] | 48 | public abstract AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 49 | where TRequest : class |
| 50 | where TResponse : class; |
| 51 | |
| 52 | /// <summary> |
| 53 | /// Invokes a client streaming call asynchronously. |
| 54 | /// In client streaming scenario, client sends a stream of requests and server responds with a single response. |
| 55 | /// </summary> |
Jan Tattermusch | b455bcc | 2016-03-22 16:08:18 -0700 | [diff] [blame] | 56 | public abstract AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 57 | where TRequest : class |
| 58 | where TResponse : class; |
| 59 | |
| 60 | /// <summary> |
| 61 | /// Invokes a duplex streaming call asynchronously. |
| 62 | /// In duplex streaming scenario, client sends a stream of requests and server responds with a stream of responses. |
| 63 | /// The response stream is completely independent and both side can be sending messages at the same time. |
| 64 | /// </summary> |
Jan Tattermusch | b455bcc | 2016-03-22 16:08:18 -0700 | [diff] [blame] | 65 | public abstract AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) |
Jan Tattermusch | 8496efa | 2016-03-22 11:34:09 -0700 | [diff] [blame] | 66 | where TRequest : class |
| 67 | where TResponse : class; |
| 68 | } |
| 69 | } |