aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/grpc/__init__.py
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2016-11-14 09:01:08 -0800
committerGravatar Ken Payson <kpayson@google.com>2016-12-08 16:12:26 -0800
commita44d3145c9f4fa761c975b1b3cc66a812fdb33f6 (patch)
tree72bc4ebad6157327cd8a474bec7cb6a986c85b01 /src/python/grpcio/grpc/__init__.py
parent11948f74414e6c95b81fbcc2f0d06afa0b1cbce5 (diff)
Allow handlers to hint at the services they export
Diffstat (limited to 'src/python/grpcio/grpc/__init__.py')
-rw-r--r--src/python/grpcio/grpc/__init__.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index 526bd9e14f..66713d3109 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -849,6 +849,26 @@ class GenericRpcHandler(six.with_metaclass(abc.ABCMeta)):
raise NotImplementedError()
+class ServiceRpcHandler(six.with_metaclass(abc.ABCMeta, GenericRpcHandler)):
+ """An implementation of RPC methods belonging to a service.
+
+ A service handles RPC methods with structured names of the form
+ '/Service.Name/Service.MethodX', where 'Service.Name' is the value
+ returned by service_name(), and 'Service.MethodX' is the service method
+ name. A service can have multiple service methods names, but only a single
+ service name.
+ """
+
+ @abc.abstractmethod
+ def service_name(self):
+ """Returns this services name.
+
+ Returns:
+ The service name.
+ """
+ raise NotImplementedError()
+
+
############################# Server Interface ###############################