Metadata-Version: 2.1
Name: run_parallel
Version: 0.0.1
Summary: Pass an array or generator of callables and `run_parallel` will run them as fast as possible.
Home-page: https://github.com/tom-010/run_parallel
Author: Thomas Deniffel
Author-email: tdeniffel@gmail.com
License: Apache2
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE

run_parallel
============

Pass an array or generator of callables and `run_parallel`
will run them as fast as possible.

Lambdas are not supported yet.

## Example

As computations are often a little bit complex, classes make 
sense often. Override the `__call__` method:

```python

class ExensiveComputation:

    def __init__(self, arg):
        self.arg = arg

    def __call__(self):
        res = self._step1(self.arg)
        res = self._step2(res)
        return res

    def _step1(self, arg):
        # expensive stuff here
        return res

    def _step2(self, arg):
        # expensive stuff here
        return res


computations = [ExensiveComputation(1), ExensiveComputation(2), ExensiveComputation(3)]
res1, res2, res3 = run_parallel(computations)

```



