##// END OF EJS Templates
Notebook: Store the username in a cookie whose name is unique....
Notebook: Store the username in a cookie whose name is unique. Cookies cannot be saved on a per-port basis, so a cookie "username" is shared across all running IPython notebooks with the same hostname. Using a unique cookie name prevents this collision. This allows a user to start multiple IPython notebooks and be logged into each.

File last commit:

r6455:15863dc1
r8340:5aca05ce
Show More
multiengine2.py
29 lines | 794 B | text/x-python | PythonLexer
#-------------------------------------------------------------------------------
# Imports
#-------------------------------------------------------------------------------
from __future__ import print_function
import time
from IPython.parallel import Client
#-------------------------------------------------------------------------------
# Setup
#-------------------------------------------------------------------------------
mux = Client()[:]
mux.clear()
mux.block=False
ar1 = mux.apply(time.sleep, 5)
ar2 = mux.push(dict(a=10,b=30,c=range(20000),d='The dog went swimming.'))
ar3 = mux.pull(('a','b','d'), block=False)
print("Try a non-blocking get_result")
ar4 = mux.get_result()
print("Now wait for all the results")
mux.wait([ar1,ar2,ar3,ar4])
print("The last pull got:", ar4.r)