cea-hpc/clustershell — Issue #137: Replace worker.last_*() by worker.current_* variables
Author: thiell
Created: 2012-03-03 16:48:29+00:00
State: open
Labels: Lib/Worker

As requested in #103, we plan to replace {{{Worker.last_read()}}}, {{{Worker.last_retcode()}}} and {{{Worker.last_node()}}} by object variables available in an event handler.

New simple variables are:
{{{
Worker.current_msg
Worker.current_errmsg
Worker.current_rc
}}}
and this one will be used only by DistantWorker subclasses, or always set to ''None'' otherwise:
{{{
Worker.current_node
}}}

This will ease management of mixed local/distant workers and avoid such ugly code part in event handler:
{{{
#!python
res = worker.last_read()
if len(res) == 2:
ns, buf = res
}}}