Utilities - kombu.utils

class kombu.utils.OrderedDict(*args, **kwds)

Dictionary that remembers insertion order

clear()

od.clear() -> None. Remove all items from od.

copy()

od.copy() -> a shallow copy of od

classmethod fromkeys(iterable, value=None)

OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None).

items()
iteritems()
iterkeys()
itervalues()
keys()
pop(key, default=<object object at 0x1002aa4c0>)
popitem(last=True)

od.popitem() -> (k, v)

Return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false.

setdefault(key, default=None)
update(other=(), **kwds)
values()
kombu.utils.maybe_list(v)
kombu.utils.partition(S, sep)
kombu.utils.repeatlast(it)

Iterate over all elements in the iterator, and when its exhausted yield the last value infinitely.

kombu.utils.retry_over_time(fun, catch, args=[], kwargs={}, errback=None, max_retries=None, interval_start=2, interval_step=2, interval_max=30)

Retry the function over and over until max retries is exceeded.

For each retry we sleep a for a while before we try again, this interval is increased for every retry until the max seconds is reached.

Parameters:
  • fun – The function to try
  • catch – Exceptions to catch, can be either tuple or a single exception class.
  • args – Positional arguments passed on to the function.
  • kwargs – Keyword arguments passed on to the function.
  • errback – Callback for when an exception in catch is raised. The callback must take two arguments: exc and interval, where exc is the exception instance, and interval is the time in seconds to sleep next..
  • max_retries – Maximum number of retries before we give up. If this is not set, we will retry forever.
  • interval_start – How long (in seconds) we start sleeping between retries.
  • interval_step – By how much the interval is increased for each retry.
  • interval_max – Maximum number of seconds to sleep between retries.
kombu.utils.rpartition(S, sep)

Previous topic

Object Utilities - kombu.abstract

Next topic

Change history

This Page