App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.tools.dev_appserver_multiprocess.ChildProcess Class Reference
Inheritance diagram for google.appengine.tools.dev_appserver_multiprocess.ChildProcess:

Public Member Functions

def __init__
 
def __str__
 
def SetHostPort
 
def Address
 
def HostPort
 
def Start
 
def EnableStartRequests
 
def Connect
 
def WaitForConnection
 
def SendStartRequest
 
def SendRequest
 
def SetFlag
 
def RemoveFlag
 

Public Attributes

 app_instance
 
 backend_id
 
 instance_id
 
 process
 
 argv
 
 started
 
 connection_handler
 
 frontend_port
 
 host
 
 port
 
 api_port
 
 start_thread
 

Constructor & Destructor Documentation

def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.__init__ (   self,
  host,
  port,
  app_instance = None,
  backend_id = None,
  instance_id = None,
  frontend_port = None 
)
Creates an object representing a child process.

Only one of the given args should be provided (except for instance_id when
backend_id is specified).

Args:
  app_instance: (int) The process represents the indicated app instance.
  backend_id: (string) The process represents a backend.
  instance_id: (int) The process represents the given backend instance.
  frontend_port: (int) for backends, the frontend port.

Member Function Documentation

def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.Address (   self)
Returns the URL for this process.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.Connect (   self)
Attempts to connect to the child process.

Returns:
  bool: Whether a connection was made.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.EnableStartRequests (   self)
Starts a thread to periodically send /_ah/start to this instance.

We need a thread to do this because we want to restart any resident Backends
that have been shutdown, and because a backend instance is not considered
to be ready for serving until it has successfully responded to /_ah/start.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.HostPort (   self)
Returns the address of this process as a (host, port) pair.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.RemoveFlag (   self,
  flag,
  short_flag = None,
  has_value = False 
)
Removes an argument from self.argv.

Args:
  flag: flag to remove.
  short_flag: one letter short version of the flag
  has_value: True if the next argument after the short flag is the value.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.SendRequest (   self,
  command,
  path,
  payload = None,
  headers = None 
)
Sends an HTTP request to this process.

Args:
  command: The HTTP command (e.g., GET, POST)
  path: The URL path for the request.
  headers: A dictionary containing headers as key-value pairs.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.SendStartRequest (   self)
If the process has not been started, sends a request to /_ah/start.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.SetFlag (   self,
  flag,
  short_flag = None,
  value = None 
)
Add a flag to self.argv, replacing the existing value if set.

Args:
  flag: flag to remove.
  short_flag: one letter short version of the flag (optional)
  value: Value of the flag (optional)
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.SetHostPort (   self,
  host,
  port 
)
Sets the host and port that this process listens on.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.Start (   self,
  argv,
  api_port 
)
Starts the child process.

Args:
  argv: The argv of the parent process. When starting the subprocess,
we make a copy of the parent's argv, then modify it in accordance with
how the ChildProcess is configured, to represent different processes in
the multiprocess dev_appserver.
  api_port: The port on which the API Server listens.
def google.appengine.tools.dev_appserver_multiprocess.ChildProcess.WaitForConnection (   self,
  timeout_s = 30.0,
  poll_period_s = 0.5 
)
Blocks until the child process has started.

This method repeatedly attempts to connect to the process on its HTTP server
port.  Returns when a connection has been successfully established or the
timeout has been reached.

Args:
  timeout_s: Amount of time to wait, in seconds.
  poll_period_s: Time to wait between connection attempts.

The documentation for this class was generated from the following file: