aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/grpc/__init__.py
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2016-12-09 12:51:34 -0800
committerGravatar GitHub <noreply@github.com>2016-12-09 12:51:34 -0800
commit5431135ce56f3515d07b4b9bde6dae5f3ca177cd (patch)
tree095ac82de2a27bbcc29d1d2f66c5d96bcf75294c /src/python/grpcio/grpc/__init__.py
parenta98778f33dc602ad474b19e2f5243972722e758e (diff)
parenta44d3145c9f4fa761c975b1b3cc66a812fdb33f6 (diff)
Merge pull request #8742 from kpayson64/service_names_hint
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 6087276d51..1c8508bbde 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 ###############################