Utilities - kombu.utils — Kombu v1.3.2 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Kombu v1.3.2 documentation »
- API Reference »

# Utilities - kombu.utils

`kombu.utils.` `cached_property`

  Property descriptor that caches the return value of the get function.

  Examples

      @cached_property
      def connection(self):
          return Connection()

      @connection.setter  # Prepares stored value
      def connection(self, value):
          if value is None:
              raise TypeError("Connection must be a connection")
          return value

      @connection.deleter
      def connection(self, value):
          # Additional action to do at del(self.attr)
          if value is not None:
              print("Connection %r deleted" % (value, ))

`kombu.utils.` `emergency_dump_state`(state, open_file=<built-in function open>, dump=None)

`kombu.utils.` `fxrange`(start=1.0, stop=None, step=1.0, repeatlast=False)

`kombu.utils.` `fxrangemax`(start=1.0, stop=None, step=1.0, max=100.0)

`kombu.utils.` `gen_unique_id`()

  Generate a unique id, having - hopefully - a very small chance of collission.

  For now this is provided by `uuid.uuid4()`.

`kombu.utils.` `kwdict`(kwargs)

  Make sure keyword arguments are not in unicode.

  This should be fixed in newer Python versions, see: http://bugs.python.org/issue4978.

`kombu.utils.` `maybe_list`(v)

`kombu.utils.` `partition`(S, sep)

`kombu.utils.` `reprcall`(name, args=(), kwargs=(), sep=', ')

`kombu.utils.` `reprkwargs`(kwargs, sep=', ', fmt='%s=%s')

`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)

`kombu.utils.` `say`(m, *s)

`kombu.utils.` `uuid4`()

### Navigation

- index
- modules |
- next |
- previous |
- Kombu v1.3.2 documentation »
- API Reference »