spawn ( parentComponent )
Return proxy,stub pair after forking child process
In the parent process, this method returns proxy,None, where proxy
is an IProcessProxy for the child process. The proxy object is
given parentComponent as its component context.
In the child process, this method returns None,stub, where stub is
the command that should be returned from the current command's run()
method, in order to start up the child process.
Note that the parent component for a process template should usually be
a new configuration root, so that the parent and child process do not
share any components unintentionally. Example usage:
template = SomeProcessTemplate(config.makeRoot())
proxy, stub = template.spawn(self)
if proxy is None:
self.mainLoop.exitWith(stub)
else:
# ... do something with the proxy
|