class documentation

class ProcessAlias(AliasBase): (source)

Constructor: ProcessAlias(path, *args)

Implements interfaces: twisted.mail.interfaces.IAlias

View In Hierarchy

An alias which is handled by the execution of a program.

Method __init__ No summary
Method __str__ Build a string representation of this ProcessAlias instance.
Method createMessageReceiver Launch a process and create a message receiver to pass a message to the process.
Method spawnProcess Spawn a process.
Instance Variable path The arguments to pass to the process. The first string is the executable's name.
Instance Variable program The path of the program to be executed.
Instance Variable reactor A reactor which will be used to create and timeout the child process.

Inherited from AliasBase:

Method domain Return the domain associated with original address.
Method resolve Map this alias to its ultimate destination.
Instance Variable domains See __init__.
Instance Variable original The original address being aliased.
def __init__(self, path, *args): (source)
Parameters
path:bytesThe command to invoke the program consisting of the path to the executable followed by any arguments.
*args:2-tuple of (0) dict mapping bytes to IDomain provider, (1) bytesArguments for AliasBase.__init__.
def __str__(self) -> str: (source)

Build a string representation of this ProcessAlias instance.

Returns
bytesA string containing the command used to invoke the process.
def createMessageReceiver(self): (source)

Launch a process and create a message receiver to pass a message to the process.

Returns
MessageWrapperA message receiver which delivers a message to the process.
def spawnProcess(self, proto, program, path): (source)

Spawn a process.

This wraps the spawnProcess method on reactor so that it can be customized for test purposes.

Parameters
proto:IProcessProtocol providerAn object which will be notified of all events related to the created process.
program:bytesThe full path name of the file to execute.
path:list of bytesThe arguments to pass to the process. The first string should be the executable's name.
Returns
IProcessTransport providerA process transport.

The arguments to pass to the process. The first string is the executable's name.

The path of the program to be executed.

A reactor which will be used to create and timeout the child process.