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

Public Member Functions

def __init__
 
def Init
 
def InitBackendEntry
 
def HttpServer
 
def Address
 
def SetHttpServer
 
def StartChildren
 
def AssignPortsRandomly
 
def __str__
 
def SetType
 
def Type
 
def IsDefault
 
def IsMaster
 
def IsSubprocess
 
def IsAppInstance
 
def IsBackend
 
def IsBackendBalancer
 
def IsBackendInstance
 
def IsBalancer
 
def IsInstance
 
def InitBalanceSet
 
def GetBalanceSet
 
def FailFast
 
def PrintStartMessage
 
def Children
 
def MaybeConfigureRemoteDataApis
 
def NewAppInfo
 
def UpdateEnv
 
def ProcessRequest
 
def HandleRequest
 
def RequestComplete
 
def UpdateSystemStub
 

Public Attributes

 process_type
 
 desc
 
 http_server
 
 app_id
 
 backends
 
 app_instance
 
 backend_id
 
 instance_id
 
 backend_entry
 
 host
 
 port
 
 api_port
 
 multiprocess_min_port
 
 children
 
 child_app_instance
 
 child_api_server
 
 balance_set
 
 started
 
 options
 
 handle_requests
 
 frontend_port
 

Static Public Attributes

string TYPE_MASTER = 'Master'
 
string TYPE_APP_INSTANCE = 'App Instance'
 
string TYPE_BACKEND_BALANCER = 'Backend Balancer'
 
string TYPE_BACKEND_INSTANCE = 'Backend Instance'
 
tuple TYPES
 

Detailed Description

Represents a process in the multiprocess dev_appserver.

Constructor & Destructor Documentation

def google.appengine.tools.dev_appserver_multiprocess.DevProcess.__init__ (   self)
Creates a DevProcess with a default configuration.

Member Function Documentation

def google.appengine.tools.dev_appserver_multiprocess.DevProcess.Address (   self)
Returns the address of this process.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.AssignPortsRandomly (   self)
Acquires a random port for each child process.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.Children (   self)
Returns the children of this process.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.FailFast (   self)
Indicates whether this process has fail-fast behavior.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.GetBalanceSet (   self)
Return the set of ports over which this process balances requests.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.HandleRequest (   self,
  request 
)
Hook that allows the DevProcess a chance to respond to requests.

This hook is invoked just before normal request dispatch occurs in
dev_appserver.py.

Args:
  request: The request to be handled.

Returns:
  bool: Indicates whether the request was handled here.  If False, normal
request handling should proceed.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.HttpServer (   self)
Returns the HTTPServer used by this process.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.Init (   self,
  appinfo,
  backends,
  options 
)
Supplies a list of backends for future use.

Args:
  appinfo: An AppInfoExternal object.
  backends: List of BackendEntry objects.
  options: Dictionary of command-line options.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.InitBackendEntry (   self)
Finds the entry for the backend this process represents, if any.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.InitBalanceSet (   self)
Construct a list of instances to balance traffic over.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsAppInstance (   self)
Indicates whether this process represents an application instance.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsBackend (   self)
Indicates whether this process represents a backend.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsBackendBalancer (   self)
Indicates whether this process represents a backend load balancer.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsBackendInstance (   self)
Indicates whether this process represents a backend instance.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsBalancer (   self)
Indicates whether this process represents a load balancer.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsDefault (   self)
Indicates whether this is the default dev_appserver process.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsInstance (   self)
Indicates whether this process represents an instance.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsMaster (   self)
Indicates whether this is the master process.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.IsSubprocess (   self)
Indicates that this is a subprocessess of the dev_appserver.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.MaybeConfigureRemoteDataApis (   self)
Set up stubs using remote_api as appropriate.

If this is the API server (or is not multiprocess), return False.
Otherwise, set up the stubs for data based APIs as remote stubs pointing at
the to the API server and return True.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.NewAppInfo (   self,
  appinfo 
)
Called when a new appinfo is read from disk on each request.

The only action we take is to apply backend settings, such as the 'start'
directive, which adds a handler for /_ah/start.

Args:
  appinfo: An AppInfoExternal to be used on the next request.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.PrintStartMessage (   self,
  app_id,
  host,
  port 
)
Print the start message for processes that are started automatically.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.ProcessRequest (   self,
  request,
  client_address 
)
Handles the SocketServer process_request call.

If the request is to a backend the request will be handled by a separate
thread. If the backend is busy a 503 response will be sent.

If this is a balancer instance each incoming request will be forwarded to
its own thread and handled there.

If no backends are configured this override has no effect.

Args:
  http_server: The http server handling the request
  request: the request to process
  client_address: the client address
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.RequestComplete (   self,
  request,
  response 
)
Invoked when the process has finished handling a request.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.SetHttpServer (   self,
  http_server 
)
Sets the http_server to be used when handling requests.

Args:
  http_server: An HTTPServer that receives requests.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.StartChildren (   self,
  argv,
  options 
)
Starts the set of child processes.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.UpdateEnv (   self,
  env_dict 
)
Copies backend port information to the supplied environment dictionary.

This information is used by the Backends API to resolve backend and instance
addresses in the dev_appserver.

User-supplied code has no access to the default environment. This method
will copy the environment variables needed for the backends api from the
default environment to the environment where user supplied code runs.

Args:
  env_dict: Dictionary with the new environment.
def google.appengine.tools.dev_appserver_multiprocess.DevProcess.UpdateSystemStub (   self,
  system_service_stub 
)
Copies info about the backends into the system stub.

Member Data Documentation

tuple google.appengine.tools.dev_appserver_multiprocess.DevProcess.TYPES
static
Initial value:
1 = frozenset([TYPE_MASTER,
2  TYPE_APP_INSTANCE,
3  TYPE_BACKEND_BALANCER,
4  TYPE_BACKEND_INSTANCE])

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