I have the same question as in this stackoverflow post and my ipython (0.13.1) does seem to have the 'Result not ready' error, so that I used the following change :
def wait_watching_stdout(ar, rc, dt=1, truncate=1000):
while not ar.ready():
rc.spin()
stdouts = [ rc.metadata[msg_id]['stdout'] for msg_id in ar.msg_ids ]
if not any(stdouts):
continue
# clear_output doesn't do much in terminal environments
clear_output()
print '-' * 30
print "%.3fs elapsed" % ar.elapsed
print ""
for eid, stdout in zip(ar._targets, stdouts):
if stdout:
print "[ stdout %2i ]\n%s" % (eid, stdout[-truncate:])
sys.stdout.flush()
time.sleep(dt)
The problem is that rc.spin seems to do something bad to my engines : they start working like crazy, hang, and then I need to kill the ipcluster command to stop them, as stopping the script is not enough.... Any idea?