Skip to content

Instantly share code, notes, and snippets.

@chrisgorgo
Created July 14, 2010 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisgorgo/475391 to your computer and use it in GitHub Desktop.
Save chrisgorgo/475391 to your computer and use it in GitHub Desktop.
from IPython.kernel import client
from nodes import DummyClass #change to wherever you've put DummyClass
taskclient = client.TaskClient()
cmdstr = "result = task.run()"
task = client.StringTask(cmdstr,
push = dict(task=DummyClass()),
pull = 'result')
tid = taskclient.run(task, block = False)
res = None
while res == None:
res = taskclient.get_task_result(tid, block = False)
print res
if res.failure:
res.raise_exception()
#must be in PYTHONPATH
class DummyClass(object):
def run(self):
return self._methodA()
def _methodA(self):
return self._methodB()
def _methodB(self):
return self._methodC()
def _methodC(self):
raise IOError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment