##// END OF EJS Templates
update API after sagedays29...
update API after sagedays29 tests, docs updated to match * Client no longer has high-level methods (only in Views) * module functions can be pushed * clients can have a connection timeout * dependencies have separate switches for success/failure, not just success_only * add `with view.temp_flags(**flags):` for temporary flags Also updated some docs and examples

File last commit:

r3664:e90463ba
r3664:e90463ba
Show More
helloworld.py
19 lines | 435 B | text/x-python | PythonLexer
"""
A Distributed Hello world
Ken Kinder <ken@kenkinder.com>
"""
from IPython.zmq.parallel import client
rc = client.Client()
def sleep_and_echo(t, msg):
import time
time.sleep(t)
return msg
view = rc.load_balanced_view()
world = view.apply_async(sleep_and_echo, 3, 'World!')
hello = view.apply_async(sleep_and_echo, 2, 'Hello')
print "Submitted tasks:", hello.msg_ids, world.msg_ids
print hello.get(), world.get()