1.1 --- a/pprocess.py Thu Sep 13 22:02:15 2007 +0000
1.2 +++ b/pprocess.py Fri Sep 14 21:33:13 2007 +0000
1.3 @@ -492,7 +492,9 @@
1.4 """
1.5 Wrap the given 'callable', using the given 'exchange' to monitor the
1.6 channels created for communications between this and the created
1.7 - processes.
1.8 + processes. Note that the 'callable' must be parallel-aware (that is,
1.9 + have a 'channel' parameter). Use the MakeParallel class to wrap other
1.10 + kinds of callable objects.
1.11 """
1.12
1.13 self.callable = callable
1.14 @@ -557,7 +559,12 @@
1.15
1.16 def __init__(self, callable):
1.17
1.18 - "Initialise the wrapper with the given 'callable'."
1.19 + """
1.20 + Initialise the wrapper with the given 'callable'. This object will then
1.21 + be able to accept a 'channel' parameter when invoked, and to forward the
1.22 + result of the given 'callable' via the channel provided back to the
1.23 + invoking process.
1.24 + """
1.25
1.26 self.callable = callable
1.27
1.28 @@ -592,10 +599,12 @@
1.29
1.30 """
1.31 Create a new process which shall start running in the given 'callable'.
1.32 - Return a communications channel to the creating process, and supply such a
1.33 - channel to the created process as the 'channel' parameter in the given
1.34 - 'callable'. Additional arguments to the 'callable' can be given as
1.35 - additional arguments to this function.
1.36 + Additional arguments to the 'callable' can be given as additional arguments
1.37 + to this function.
1.38 +
1.39 + Return a communications channel to the creating process. For the created
1.40 + process, supply a channel as the 'channel' parameter in the given 'callable'
1.41 + so that it may send data back to the creating process.
1.42 """
1.43
1.44 channel = create()
1.45 @@ -626,8 +635,12 @@
1.46
1.47 """
1.48 A parallel version of the built-in map function with an optional process
1.49 - 'limit'. The given 'callable' need not be parallel-aware since it will be
1.50 - wrapped for parallel communications before invocation.
1.51 + 'limit'. The given 'callable' should not be parallel-aware (that is, have a
1.52 + 'channel' parameter) since it will be wrapped for parallel communications
1.53 + before being invoked.
1.54 +
1.55 + Return the processed 'sequence' where each element in the sequence is
1.56 + processed by a different process.
1.57 """
1.58
1.59 mymap = Map(limit=limit)