Part of twisted.internet.iocpreactor.process View Source View In Hierarchy
A process that integrates with the Twisted event loop.
See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp for more info on how to create processes in Windows and access their stdout/err/in. Another good source is http://www.informit.com/articles/article.asp?p=362660&seqNum=2.
Issues:
If your subprocess is a python program, you need to:import os, sys, mscvrt msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
Method | __init__ | Undocumented |
Method | signalProcess | Send a signal to the process. |
Method | startWriting | Undocumented |
Method | stopWriting | Undocumented |
Method | writeDone | Undocumented |
Method | write | Write data to the process' stdin. |
Method | writeSequence | Write a list of strings to the physical connection. |
Method | closeStdin | Close the process' stdin. |
Method | _closeStdin | Undocumented |
Method | closeStderr | Close stderr. |
Method | closeStdout | Close stdout. |
Method | loseConnection | Close the process' stdout, in and err. |
Method | outConnectionLost | Undocumented |
Method | errConnectionLost | Undocumented |
Method | inConnectionLost | Undocumented |
Method | connectionLostNotify | Will be called 3 times, for stdout/err/in. |
Method | processEnded | Undocumented |
Method | connectionLost | Shut down resources. |
Method | registerProducer | Register to receive data from a producer. |
Method | unregisterProducer | Stop consuming data from a producer, without disconnecting. |
Parameters | signalID | can be
|
Raises | twisted.internet.error.ProcessExitedAlready | The process has already exited. |
Write a list of strings to the physical connection.
If possible, make sure that all of the data is written to the socket at once, without first copying it all into a single string.Register to receive data from a producer.
This sets self to be a consumer for a producer. When this object runs out of data (as when a send(2) call on a socket succeeds in moving the last data from a userspace buffer into a kernelspace buffer), it will ask the producer to resumeProducing().
For IPullProducer
providers, resumeProducing
will be called once each time
data is required.
IPushProducer
providers, pauseProducing
will be called whenever the write
buffer fills up and resumeProducing
will only be called when
it empties.
Parameters | producer | (type: IProducer
provider
) |
streaming | True if producer provides IPushProducer ,
False if producer provides IPullProducer .
(type: bool
) | |
Returns | None
|