Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cs.later-20160828.tar.gz (13.3 kB view details)

Uploaded Source

File details

Details for the file cs.later-20160828.tar.gz.

File metadata

  • Download URL: cs.later-20160828.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cs.later-20160828.tar.gz
Algorithm Hash digest
SHA256 bda6b523ddc5a7b8ab5b10db5f34783b831e941cde74f5d19bb7301fdd505f15
MD5 8de15335f58f17a715196bad4dd263dd
BLAKE2b-256 069e52f9018f14b194f374a5b12178cb99116870fbb0cce5670f73e61170ace8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page