def __init__(self, request_data, runtime_config_getter,
                 module_configuration):
        """Initializer for GoRuntimeInstanceFactory.

    Args:
      request_data: A wsgi_request_info.WSGIRequestInfo that will be provided
          with request information for use by API stubs.
      runtime_config_getter: A function that can be called without arguments
          and returns the runtime_config_pb2.RuntimeConfig containing the
          configuration for the runtime.
      module_configuration: An application_configuration.ModuleConfiguration
          instance respresenting the configuration of the module that owns the
          runtime.
    """
        super(GoRuntimeInstanceFactory, self).__init__(request_data, 1)
        self._runtime_config_getter = runtime_config_getter
        self._module_configuration = module_configuration
        self._application_lock = threading.Lock()
        if (module_configuration.runtime == 'vm'
                and 'GAE_LOCAL_VM_RUNTIME' in os.environ):
            self._start_process_flavor = http_runtime.START_PROCESS_REVERSE
            self._go_application = go_managedvm.GoManagedVMApp(
                self._module_configuration)
        else:
            self._start_process_flavor = http_runtime.START_PROCESS
            self._go_application = go_application.GoApplication(
                self._module_configuration)
        self._modified_since_last_build = False
        self._last_build_error = None
示例#2
0
    def __init__(self, request_data, runtime_config_getter,
                 server_configuration):
        """Initializer for GoRuntimeInstanceFactory.

    Args:
      request_data: A wsgi_request_info.WSGIRequestInfo that will be provided
          with request information for use by API stubs.
      runtime_config_getter: A function that can be called without arguments
          and returns the runtime_config_pb2.RuntimeConfig containing the
          configuration for the runtime.
      server_configuration: An application_configuration.ServerConfiguration
          instance respresenting the configuration of the server that owns the
          runtime.
    """
        super(GoRuntimeInstanceFactory, self).__init__(request_data, 1)
        self._runtime_config_getter = runtime_config_getter
        self._server_configuration = server_configuration
        self._application_lock = threading.Lock()
        self._go_application = go_application.GoApplication(
            self._server_configuration)
        self._modified_since_last_build = False