示例#1
0
def test5():
    print ("test 5: custom objects")
    objects = map(Foo, range(10))

    pool = Pool(custom=["Foo"])
    print pool.map(fobj, objects)
示例#2
0
def test4():
    print ("\ntest 4: imap_unordered with 2 arguments")
    pool = Pool()
    it = pool.imap_unordered(g, list(range(10)), list(range(20, 30)))
    print ("->", sum(it))
示例#3
0
def test2():
    print ("\ntest 2: imap_unordered")
    pool = Pool()
    it = pool.imap_unordered(f, list(range(10)))
    print ("->", sum(it))
示例#4
0
def test3():
    print ("\ntest 3: map with 2 arguments")
    pool = Pool()
    print ("->", sum(pool.map(g, list(range(10)), list(range(20, 30)))))
示例#5
0
def test1():
    print ("\ntest 1: map")
    pool = Pool()
    print ("->", sum(pool.map(f, list(range(10)))))