但是在ipython parallel的apply_async似乎不支援callback的用法,所以後來我在stackoverflow找到了一個簡單的處理事件完成的解法如下:
c = Client()
dview = c[:]
asyncs = [dview.map_async(f, [arg]) for arg in args]
while asyncs:
for async in asyncs[:]:
if async.ready():
asyncs.remove(async)
print async.result[0]