aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.HealthCheck
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-03-14 16:08:39 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-04-01 16:25:41 -0700
commiteeef5edd7aa251d1ce6804fdc4997bdf12ad907a (patch)
tree22123349ea53db31e027fee107bf918e08354283 /src/csharp/Grpc.HealthCheck
parentd39426d5053dc1a94910721dc0788d2ecf2cbf06 (diff)
regenerate protos
Diffstat (limited to 'src/csharp/Grpc.HealthCheck')
-rw-r--r--src/csharp/Grpc.HealthCheck/HealthGrpc.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
index 68320eb5c2..fffdf03be4 100644
--- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
+++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs
@@ -38,11 +38,22 @@ namespace Grpc.Health.V1 {
}
// server-side interface
+ [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
public interface IHealth
{
Task<global::Grpc.Health.V1.HealthCheckResponse> Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context);
}
+ // server-side abstract class
+ public abstract class HealthBase
+ {
+ public virtual Task<global::Grpc.Health.V1.HealthCheckResponse> Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context)
+ {
+ throw new RpcException(new Status(StatusCode.Unimplemented, ""));
+ }
+
+ }
+
// client stub
public class HealthClient : ClientBase, IHealthClient
{
@@ -78,6 +89,13 @@ namespace Grpc.Health.V1 {
.AddMethod(__Method_Check, serviceImpl.Check).Build();
}
+ // creates service definition that can be registered with a server
+ public static ServerServiceDefinition BindService(HealthBase serviceImpl)
+ {
+ return ServerServiceDefinition.CreateBuilder(__ServiceName)
+ .AddMethod(__Method_Check, serviceImpl.Check).Build();
+ }
+
// creates a new client
public static HealthClient NewClient(Channel channel)
{