Discussion:
[Python-3000-checkins] r67335 - python/branches/py3k/Doc/library/multiprocessing.rst
georg.brandl
2008-11-22 08:54:21 UTC
Permalink
Author: georg.brandl
Date: Sat Nov 22 09:54:21 2008
New Revision: 67335

Log:
Fix two mp doc issues from #4012.


Modified:
python/branches/py3k/Doc/library/multiprocessing.rst

Modified: python/branches/py3k/Doc/library/multiprocessing.rst
==============================================================================
--- python/branches/py3k/Doc/library/multiprocessing.rst (original)
+++ python/branches/py3k/Doc/library/multiprocessing.rst Sat Nov 22 09:54:21 2008
@@ -232,7 +232,7 @@

if __name__ == '__main__':
pool = Pool(processes=4) # start 4 worker processes
- result = pool.applyAsync(f, [10]) # evaluate "f(10)" asynchronously
+ result = pool.apply_async(f, [10]) # evaluate "f(10)" asynchronously
print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]"

@@ -1505,7 +1505,7 @@
The class of the result returned by :meth:`Pool.apply_async` and
:meth:`Pool.map_async`.

- .. method:: get([timeout)
+ .. method:: get([timeout])

Return the result when it arrives. If *timeout* is not ``None`` and the
result does not arrive within *timeout* seconds then
@@ -1535,7 +1535,7 @@
if __name__ == '__main__':
pool = Pool(processes=4) # start 4 worker processes

- result = pool.applyAsync(f, (10,)) # evaluate "f(10)" asynchronously
+ result = pool.apply_async(f, (10,)) # evaluate "f(10)" asynchronously
print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow

print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]"
@@ -1546,7 +1546,7 @@
print(it.next(timeout=1)) # prints "4" unless your computer is *very* slow

import time
- result = pool.applyAsync(time.sleep, (10,))
+ result = pool.apply_async(time.sleep, (10,))
print(result.get(timeout=1)) # raises TimeoutError

Loading...