Utilities

Warning

External usage of internal utility functions and modules should be kept to a minimum as they may be altered, refactored or moved to other locations without notice (and without the typical deprecation cycle).

Async

Deprecation

Eventlet

Iterators

taskflow.utils.iter_utils.count(it)[source]

Returns how many values in the iterator (depletes the iterator).

taskflow.utils.iter_utils.find_first_match(it, matcher, not_found_value=None)[source]

Searches iterator for first value that matcher callback returns true.

taskflow.utils.iter_utils.while_is_not(it, stop_value)[source]

Yields given values from iterator until stop value is passed.

This uses the is operator to determine equivalency (and not the == operator).

Kazoo

Kombu

class taskflow.utils.kombu_utils.DelayedPretty(message)[source]

Bases: object

Wraps a message and delays prettifying it until requested.

TODO(harlowja): remove this when https://github.com/celery/kombu/pull/454/ is merged and a release is made that contains it (since that pull request is equivalent and/or better than this).

Miscellaneous

Mixins

class taskflow.utils.mixins.StrMixin[source]

Bases: object

Mixin that helps deal with the PY2 and PY3 method differences.

http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/ explains why this is quite useful...

Persistence

Redis

Schema

Threading