|
1 |
| -// Generated by the protocol buffer compiler. DO NOT EDIT! |
2 |
| -// source: Protos.proto |
| 1 | +// ----------------------------------------------------------------------- |
| 2 | +// <copyright file="ProtosGrpc.cs" company="Asynkron HB"> |
| 3 | +// Copyright (C) 2015-2017 Asynkron HB All rights reserved |
| 4 | +// </copyright> |
| 5 | +// ----------------------------------------------------------------------- |
3 | 6 | #region Designer generated code
|
4 | 7 |
|
5 | 8 | using System;
|
6 | 9 | using System.Threading;
|
7 |
| -using System.Threading.Tasks; |
8 | 10 | using Grpc.Core;
|
9 | 11 |
|
10 | 12 | namespace Proto.Remote {
|
11 | 13 | public static class Remoting
|
12 | 14 | {
|
13 |
| - static readonly string __ServiceName = "remote.Remoting"; |
| 15 | + static readonly string __ServiceName = "remote.Remoting"; |
14 | 16 |
|
15 |
| - static readonly Marshaller<global::Proto.Remote.MessageBatch> __Marshaller_MessageBatch = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Proto.Remote.MessageBatch.Parser.ParseFrom); |
16 |
| - static readonly Marshaller<global::Proto.Remote.Unit> __Marshaller_Unit = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Proto.Remote.Unit.Parser.ParseFrom); |
| 17 | + static readonly Marshaller<global::Proto.Remote.MessageBatch> __Marshaller_MessageBatch = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Proto.Remote.MessageBatch.Parser.ParseFrom); |
| 18 | + static readonly Marshaller<global::Proto.Remote.Unit> __Marshaller_Unit = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Proto.Remote.Unit.Parser.ParseFrom); |
17 | 19 |
|
18 |
| - static readonly Method<global::Proto.Remote.MessageBatch, global::Proto.Remote.Unit> __Method_Receive = new Method<global::Proto.Remote.MessageBatch, global::Proto.Remote.Unit>( |
| 20 | + static readonly Method<global::Proto.Remote.MessageBatch, global::Proto.Remote.Unit> __Method_Receive = new Method<global::Proto.Remote.MessageBatch, global::Proto.Remote.Unit>( |
19 | 21 | MethodType.DuplexStreaming,
|
20 | 22 | __ServiceName,
|
21 | 23 | "Receive",
|
22 | 24 | __Marshaller_MessageBatch,
|
23 | 25 | __Marshaller_Unit);
|
24 | 26 |
|
25 |
| - /// <summary>Service descriptor</summary> |
| 27 | + /// <summary>Service descriptor</summary> |
26 | 28 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
|
27 | 29 | {
|
28 | 30 | get { return global::Proto.Remote.ProtosReflection.Descriptor.Services[0]; }
|
29 | 31 | }
|
30 | 32 |
|
31 |
| - /// <summary>Base class for server-side implementations of Remoting</summary> |
| 33 | + /// <summary>Creates service definition that can be registered with a server</summary> |
| 34 | + public static ServerServiceDefinition BindService(RemotingBase serviceImpl) |
| 35 | + { |
| 36 | + return ServerServiceDefinition.CreateBuilder() |
| 37 | + .AddMethod(__Method_Receive, serviceImpl.Receive).Build(); |
| 38 | + } |
| 39 | + |
| 40 | + /// <summary>Base class for server-side implementations of Remoting</summary> |
32 | 41 | public abstract class RemotingBase
|
33 | 42 | {
|
34 |
| - public virtual global::System.Threading.Tasks.Task Receive(IAsyncStreamReader<global::Proto.Remote.MessageBatch> requestStream, IServerStreamWriter<global::Proto.Remote.Unit> responseStream, ServerCallContext context) |
| 43 | + public virtual global::System.Threading.Tasks.Task Receive(IAsyncStreamReader<global::Proto.Remote.MessageBatch> requestStream, IServerStreamWriter<global::Proto.Remote.Unit> responseStream, ServerCallContext context) |
35 | 44 | {
|
36 | 45 | throw new RpcException(new Status(StatusCode.Unimplemented, ""));
|
37 | 46 | }
|
38 |
| - |
39 | 47 | }
|
40 | 48 |
|
41 |
| - /// <summary>Client for Remoting</summary> |
| 49 | + /// <summary>Client for Remoting</summary> |
42 | 50 | public class RemotingClient : ClientBase<RemotingClient>
|
43 | 51 | {
|
44 |
| - /// <summary>Creates a new client for Remoting</summary> |
| 52 | + /// <summary>Creates a new client for Remoting</summary> |
45 | 53 | /// <param name="channel">The channel to use to make remote calls.</param>
|
46 | 54 | public RemotingClient(Channel channel) : base(channel)
|
47 | 55 | {
|
48 | 56 | }
|
49 |
| - /// <summary>Creates a new client for Remoting that uses a custom <c>CallInvoker</c>.</summary> |
| 57 | + |
| 58 | + /// <summary>Creates a new client for Remoting that uses a custom <c>CallInvoker</c>.</summary> |
50 | 59 | /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
|
51 | 60 | public RemotingClient(CallInvoker callInvoker) : base(callInvoker)
|
52 | 61 | {
|
53 | 62 | }
|
54 |
| - /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 63 | + |
| 64 | + /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
55 | 65 | protected RemotingClient() : base()
|
56 | 66 | {
|
57 | 67 | }
|
58 |
| - /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 68 | + |
| 69 | + /// <summary>Protected constructor to allow creation of configured clients.</summary> |
59 | 70 | /// <param name="configuration">The client configuration.</param>
|
60 | 71 | protected RemotingClient(ClientBaseConfiguration configuration) : base(configuration)
|
61 | 72 | {
|
62 | 73 | }
|
63 | 74 |
|
64 |
| - public virtual AsyncDuplexStreamingCall<global::Proto.Remote.MessageBatch, global::Proto.Remote.Unit> Receive(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 75 | + public virtual AsyncDuplexStreamingCall<global::Proto.Remote.MessageBatch, global::Proto.Remote.Unit> Receive(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
65 | 76 | {
|
66 | 77 | return Receive(new CallOptions(headers, deadline, cancellationToken));
|
67 | 78 | }
|
68 |
| - public virtual AsyncDuplexStreamingCall<global::Proto.Remote.MessageBatch, global::Proto.Remote.Unit> Receive(CallOptions options) |
| 79 | + |
| 80 | + public virtual AsyncDuplexStreamingCall<global::Proto.Remote.MessageBatch, global::Proto.Remote.Unit> Receive(CallOptions options) |
69 | 81 | {
|
70 | 82 | return CallInvoker.AsyncDuplexStreamingCall(__Method_Receive, null, options);
|
71 | 83 | }
|
72 |
| - protected override RemotingClient NewInstance(ClientBaseConfiguration configuration) |
| 84 | + |
| 85 | + protected override RemotingClient NewInstance(ClientBaseConfiguration configuration) |
73 | 86 | {
|
74 | 87 | return new RemotingClient(configuration);
|
75 | 88 | }
|
76 | 89 | }
|
77 |
| - |
78 |
| - /// <summary>Creates service definition that can be registered with a server</summary> |
79 |
| - public static ServerServiceDefinition BindService(RemotingBase serviceImpl) |
80 |
| - { |
81 |
| - return ServerServiceDefinition.CreateBuilder() |
82 |
| - .AddMethod(__Method_Receive, serviceImpl.Receive).Build(); |
83 |
| - } |
84 |
| - |
85 | 90 | }
|
86 | 91 | }
|
87 | 92 | #endregion
|
0 commit comments