Logo Search packages:      
Sourcecode: nagios-plugins version File versions  Download package

utils::Task Class Reference

List of all members.


Detailed Description

Manage asynchronous subprocess tasks.
   This differs from the 'subproc' package!
    - 'subproc' connects to the subprocess via pipes
    - 'task' lets the subprocess run autonomously.
   After starting the task, we can just:
    - ask whether it is finished yet
    - wait until it is finished
    - perform an 'idle' task (e.g. Tkinter's mainloop) while waiting for
      subprocess termination
    - kill the subprocess with a specific signal
    - ask for the exit code.
   Summarizing:
    - 'subproc' is a sophisticated os.popen()
    - 'task' is a sophisticated os.system()
   Another difference of task with 'subproc':
    - If the Task() object is deleted, before the subprocess status
      was retrieved, the child process will stay.
      It will never be waited for (i.e., the process will turn into
      a zombie. Not a good idea in general).

   Public data:
       None.

   Public methods:
       __init__, __str__, Run, Wait, Kill, Done, Status.

Definition at line 44 of file utils.py.


Public Member Functions

def __init__
def __str__
def Done
def Kill
def Run
def Status
def Wait

Public Attributes

 cmd
 pid
 status
 words

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index