##// END OF EJS Templates
Merge pull request #2829 from minrk/nodate...
Merge pull request #2829 from minrk/nodate avoid comparison error in dictdb hub history in rare situations, display data can arrive at the Hub before the execution request, in which case `submitted` is undefined. should address #2821, but I need to see Jenkins succeed, since that is the only place this comes up.

File last commit:

r9190:20a102a5
r9235:939887fa merge
Show More
helloworld.py
35 lines | 596 B | text/x-python | PythonLexer
# <nbformat>2</nbformat>
# <markdowncell>
# # Distributed hello world
#
# Originally by Ken Kinder (ken at kenkinder dom com)
# <codecell>
from __future__ import print_function
from IPython.parallel import Client
# <codecell>
rc = Client()
view = rc.load_balanced_view()
# <codecell>
def sleep_and_echo(t, msg):
import time
time.sleep(t)
return msg
# <codecell>
world = view.apply_async(sleep_and_echo, 3, 'World!')
hello = view.apply_async(sleep_and_echo, 2, 'Hello')
# <codecell>
print("Submitted tasks:", hello.msg_ids, world.msg_ids)
print(hello.get(), world.get())