Utilities for easy parallelisation of tasks
Project description
The idea is to have an ubber simple decorator
which simply defers the calculation of any function
or method off process.
The decorated function returns a lazy object,
which will just attempt to retrieve the actual
return value of the function when it is about to
be used in any Python expression.
Currently, the only public member in the
project is the "parallel" decorator, which is used just as:
@parallel
def retr_url(url):
return urllib.urlopen(url).read()
-And voilá - upon calling the above "retr_url",
execution simply proceeds, while Python multiprocessing
creates another process to actually download the url
contents.
Unlike Python's 3.2 concurrent.futures, there is no
setup needed - just decorate your function
and you are all set-up to go.
Tested with Python 2.7, 3.2, 3.3, and Pypy 1.8.0
which simply defers the calculation of any function
or method off process.
The decorated function returns a lazy object,
which will just attempt to retrieve the actual
return value of the function when it is about to
be used in any Python expression.
Currently, the only public member in the
project is the "parallel" decorator, which is used just as:
@parallel
def retr_url(url):
return urllib.urlopen(url).read()
-And voilá - upon calling the above "retr_url",
execution simply proceeds, while Python multiprocessing
creates another process to actually download the url
contents.
Unlike Python's 3.2 concurrent.futures, there is no
setup needed - just decorate your function
and you are all set-up to go.
Tested with Python 2.7, 3.2, 3.3, and Pypy 1.8.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lelo-1.0rc3dev.tar.gz
(3.3 kB
view details)
File details
Details for the file lelo-1.0rc3dev.tar.gz
.
File metadata
- Download URL: lelo-1.0rc3dev.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 723f174a75161d7fecab9fe096a04364afbbcbda1d79606b455d121031255b52 |
|
MD5 | d3bc23a3a62583235afc3f2f0f40facc |
|
BLAKE2b-256 | 7cbfa98ac17bca7889eca0ebac330277dd371737276aa22a554a565a698687f1 |