Esempio n. 1
0
def server(service_implementations, options=None):
    """Creates an interfaces.Server with which RPCs can be serviced.

  Args:
    service_implementations: A dictionary from service name-method name pair to
      face.MethodImplementation.
    options: An optional ServerOptions value further customizing the
      functionality of the returned Server.

  Returns:
    An interfaces.Server with which RPCs can be serviced.
  """
    effective_options = _EMPTY_SERVER_OPTIONS if options is None else options
    return _server.server(
        service_implementations, effective_options.multi_method_implementation,
        effective_options.request_deserializers,
        effective_options.response_serializers, effective_options.thread_pool,
        effective_options.thread_pool_size, effective_options.default_timeout,
        effective_options.maximum_timeout)
Esempio n. 2
0
def server(service_implementations, options=None):
  """Creates an interfaces.Server with which RPCs can be serviced.

  Args:
    service_implementations: A dictionary from service name-method name pair to
      face.MethodImplementation.
    options: An optional ServerOptions value further customizing the
      functionality of the returned Server.

  Returns:
    An interfaces.Server with which RPCs can be serviced.
  """
  effective_options = _EMPTY_SERVER_OPTIONS if options is None else options
  return _server.server(
      service_implementations, effective_options.multi_method_implementation,
      effective_options.request_deserializers,
      effective_options.response_serializers, effective_options.thread_pool,
      effective_options.thread_pool_size, effective_options.default_timeout,
      effective_options.maximum_timeout)