Package PyFoam :: Package ThirdParty :: Package Gnuplot :: Module PlotItems :: Class _FIFOWriter
[hide private]
[frames] | no frames]

Class _FIFOWriter

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        _FIFOWriter

Create a FIFO (named pipe), write to it, then delete it.

The writing takes place in a separate thread so that the main thread is not blocked. The idea is that once the writing is finished we know that gnuplot is done with the data that were in the file so we can delete the file. This technique removes the ambiguity about when the temporary files should be deleted.

Since the tempfile module does not provide an easy, secure way to create a FIFO without race conditions, we instead create a temporary directory using mkdtemp() then create the FIFO within that directory. When the writer thread has written the full information to the FIFO, it deletes both the FIFO and the temporary directory that contained it.

Instance Methods [hide private]
 
__init__(self, content, mode='w')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
run(self) source code

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, content, mode='w')
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

run(self)

source code 
Overrides: threading.Thread.run