Skip to main content

A Twisted class for observing a set of deferreds.

Project description

txdlo is a Python package that provides a class called DeferredListObserver.

As you might guess, DeferredListObserver lets you observe callback and errback events from a list of Twisted deferreds. You can add observers that will be passed information about deferreds firing. You can add deferreds to the observed list at any time, which is very useful if you’re dynamically creating deferreds that you want to monitor.

The class can be used to easily build functions or classes that provide deferreds that fire when arbitrary combinations of events from the observed deferreds have occurred.

For example you can write functions or classes that support deferreds that

  • Implement Twisted’s DeferredList or simple variants of it, or that let you separate the various behaviors of DeferredList into simpler functions.

  • Provide a deferred that fires when N of the observed deferreds have fired.

  • Provide a deferred that ignores errors until one of the observed deferred succeeds, only firing with an error if all the observed deferreds fail.

  • Or (a more involved example), suppose you have 3 methods that can return you a user’s avatar: a fast local cache, a filesystem, and a slow network call to Gravatar. You want to write a deferred-returning function that launches all three lookups at once and fires its deferred with the first answer. But if the cache and/or filesystems fails first, you don’t want to trigger an error, you instead want to take the result from Gravatar and add it to the cache and/or filesystem, as well firing the returned deferred with the result (wherever it comes from). Only if all three lookups fail do you want to errback the deferred you returned.

The source for txdlo lives at https://github.com/terrycojones/txdlo.

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

txdlo-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

txdlo-0.1.1-py2.py3-none-any.whl (7.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file txdlo-0.1.1.tar.gz.

File metadata

  • Download URL: txdlo-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for txdlo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3fd7caa2573ad8f7caf45297987432df86167d09e01781dd0c76caf9f5ea4a9b
MD5 4b8a7ba40eb230ec1cc86f367cbd6da3
BLAKE2b-256 34056f92b349ce20160f5c88bc25561e6f5641145d9bf58de328669314e1e1fd

See more details on using hashes here.

File details

Details for the file txdlo-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for txdlo-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 67a1d7c3d7df00027d9f99592b18af2693da37839f3fc4e5de85dec91ace4373
MD5 2201df5fb1636a4713f56a72fcb0cc07
BLAKE2b-256 0d3c6a829e6a5809d41da3a3ef6925bfe06312a0b9469f080dee9141a2e54a82

See more details on using hashes here.

Supported by

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