##// END OF EJS Templates
Fixed foolscap imports....
Fixed foolscap imports. As of Foolscap 0.4.3, foolscap introduces a foolscap.api module that all top-level symbols must be imported from. Fixes https://bugs.launchpad.net/ipython/+bug/525805

File last commit:

r1395:1feaf0a3
r2526:ec6b47e5
Show More
multienginemap.py
17 lines | 414 B | text/x-python | PythonLexer
from IPython.kernel import client
mec = client.MultiEngineClient()
result = mec.map(lambda x: 2*x, range(10))
print "Simple, default map: ", result
m = mec.mapper(block=False)
pr = m.map(lambda x: 2*x, range(10))
print "Submitted map, got PendingResult: ", pr
result = pr.r
print "Using a mapper: ", result
@mec.parallel()
def f(x): return 2*x
result = f(range(10))
print "Using a parallel function: ", result