[IPython-dev] async taskclient

Vishal Vatsa vishal.vatsa at gmail.com
Fri Jun 20 06:46:45 EDT 2008


Hi Guys,

I have a question about how to use the async task client.
Given the following code:

def job_runner(code):

    def submit(task_client, cmd):
        t1 = Task(cmd, clear_before=True, clear_after=True, pull=['a'])
        d = task_client.run(t1)
        d.addCallback(lambda tid:
task_client.get_task_result(taskid=tid, block=True))
        d.addBoth(printer)

    d = asyncclient.get_task_client()
    d.addCallback(lambda tc: submit(tc, code))


where code is some python code in a string.

Is it ok to get a new instance of async task client for every
job I want to submit?



More information about the IPython-dev mailing list