Package pulp :: Package server :: Package tasking :: Module task :: Class Task
[hide private]
[frames] | no frames]

Class Task

source code

object --+
         |
        Task

Task class Meta data for executing a long-running task.

Instance Methods [hide private]
 
__init__(self, callable, args=[], kwargs={}, timeout=None)
Create a Task for the passed in callable and arguments.
source code
 
_exception_event(self)
Let the contextual thread know that an exception has been received.
source code
 
set_progress(self, arg, callback)
Setup a progress callback for the task, if it accepts one
source code
 
run(self)
Run this task and record the result or exception.
source code
 
progress_callback(self, *args, **kwargs)
Provide a callback for runtime progress reporting.
source code
 
reset(self)
Reset this task's recorded data.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, callable, args=[], kwargs={}, timeout=None)
(Constructor)

source code 

Create a Task for the passed in callable and arguments.

Parameters:
  • callable - function, method, lambda, or object with __call__
  • args - positional arguments to be passed into the callable
  • kwargs - keyword arguments to be passed into the callable
  • timeout (datetime.timedelta instance or None) - maximum length of time to allow task to run, None means indefinitely
Overrides: object.__init__

set_progress(self, arg, callback)

source code 

Setup a progress callback for the task, if it accepts one

Parameters:
  • arg (str) - name of the callable's progress callback argument
  • callback (callable, returning a dict) - value of the callable's progress callback argument