[IPython-dev] New TaskResult object in ipython1's task farming interface
Brian Granger
ellisonbg.net at gmail.com
Mon Jun 18 12:53:14 EDT 2007
Hi,
Over the weekend, I did some work to improve the task farming
interface. The main change is that the getResult method now returns a
new TaskResult object. This object provides a much simpler and
intuitive way of accessing task results. If you are using the task
system, please do an svn up (of saw) and try this out. Let us know if
you find problems or if there are further improvements/changes that
you would like to see.
Here is a brief description of the TaskResult object:
A TaskResult instance is returned when getTaskResult is called. It
has the following attributes:
engineID - the id of the engine that did the task
taskID - the integer task id that the task is tracked by
failure - a twisted failure object if the task failed otherwise None
keys - a list of variable names that were pulled back (the
resultNames). The values of these keys are also available as
attributes of the instance:
if resultNames = ['a','b']
and
tr =getTaskResult(taskID)
then
tr.a
tr.b
Has the values of a and b.
The TaskResult object also has a raiseException method that will
re-raise any remote exceptions that occurred in the running of the
task.
Cheers,
Brian
More information about the IPython-dev
mailing list