queue functions for execution later
Project description
I use Later objects for convenient queuing of functions whose execution occurs later in a priority order with capacity constraints.
Why not futures? I already had this, I prefer its naming scheme and interface, and futures did not seem to support prioritising execution.
Use is simple enough: create a Later instance and typically queue functions with the .defer() method:
L = Later(4) # a Later with a parallelism of 4 ... LF = L.defer(func, *args, **kwargs) ... x = LF() # collect result
The .defer method and its sublings return a LateFunction, which is a subclass of cs.asynchron.Asynchron. As such it is a callable, so to collect the result you just call the LateFunction.
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
File details
Details for the file cs.later-20150115.tar.gz.
File metadata
- Download URL: cs.later-20150115.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e148c6c57753733a8c31b991910c5d8754e9127494d48deacefb5fb47be3a3d9
|
|
| MD5 |
d2f39b53753c22e0603c61bfd624b9de
|
|
| BLAKE2b-256 |
cd50b83712eab7c82583f8edf0cf1cfb663b8ec27704853374bb336f21beebb8
|