code: def register(
              self,
              rule,
              handler,
              req_serializer=None,
              resp_serializer=None
      ):
          
  
          assert handler, "handler must not be None"
          req_serializer = req_serializer or RawSerializer()
          resp_serializer = resp_serializer or RawSerializer()
          self.handlers[rule] = Handler(handler, req_serializer, resp_serializer)
docs: Register a new endpoint with the given name.
  
          .. code-block:: python
  
              @dispatcher.register('is_healthy')
              def check_health(request, response):
                  # ...
  
          :param rule:
              Name of the endpoint. Incoming Call Requests must have this as
              ``arg1`` to dispatch to this handler.
  
              If ``RequestHandler.FALLBACK`` is specified as a rule, the given
              handler will be used as the 'fallback' handler when requests don't
              match any registered rules.
  
          :param handler:
              A function that gets called with ``Request`` and ``Response``.
  
          :param req_serializer:
              Arg scheme serializer of this endpoint. It should be
              ``RawSerializer``, ``JsonSerializer``, and ``ThriftSerializer``.
  
          :param resp_serializer:
              Arg scheme serializer of this endpoint. It should be
              ``RawSerializer``, ``JsonSerializer``, and ``ThriftSerializer``.