Search code examples
pythonpipetwistedfile-descriptormkfifo

Example for using Python Twisted with File Descriptors


I'm looking to use twisted to control communication across Linux pipes (os.pipe()) and fifos (os.mkfifo()) between a master process and a set of slave processes. While I'm positive tat it's possible to use twisted for these types of file descriptors (after all, twisted is great for tcp sockets which *nix abstracts away as file descriptors), I cannot find any examples of this type of usage. Anyone have any links, sample code, or advice?


Solution

  • It does not have anything built-in for asynchronous I/O. Someone wrote a libaio wrapper for it, but it has not been touched for a long time, and I have no idea if it still works.

    In the worst case you could use select to see if there's anything available to read, but that won't help you with writing.