map_async(funciterable [chunksize [callback]]the same as map(except that the result is returned asynchronously the return value is an instance of asyncresult that can be used to later obtain the result callback is callable object accepting single argument if suppliedcallback is called with the result when it becomes available terminate(immediately terminates all of the worker processes without performing any cleanup or finishing any pending work if is garbage-collectedthis is called the methods apply_async(and map_async(return an asyncresult instance as result an instance of asyncresult has the following methodsa get([timeout]returns the resultwaiting for it to arrive if necessary timeout is an optional timeout if the result does not arrive in the given timea multiprocessing timeouterror exception is raised if an exception was raised in the remote operationit is reraised when this method is called ready(returns true if the call has completed sucessful(returns true if the call completed without any exceptions an assertionerror is raised if this method is called prior to the result being ready wait([timeout]waits for the result to become available timeout is an optional timeout the following example illustrates the use of process pool to build dictionary mapping filenames to sha digest values for an entire directory of filesimport os import multiprocessing import hashlib some parameters you can tweak bufsize read buffer size poolsize number of workers def compute_digest(filename)tryf open(filename,"rb"except ioerrorreturn none digest hashlib sha (while truechunk read(bufsizeif not chunkbreak digest update(chunkf close(return filenamedigest digest(def build_digest_map(topdir)digest_pool multiprocessing pool(poolsizef lib fl ff