loopingcall

class oslo_service.loopingcall.DynamicLoopingCall(f=None, *args, **kw)

Bases: oslo_service.loopingcall.LoopingCallBase

A looping call which sleeps until the next known event.

The function called should return how long to sleep for before being called again.

start(initial_delay=None, periodic_interval_max=None, stop_on_exception=True)
class oslo_service.loopingcall.FixedIntervalLoopingCall(f=None, *args, **kw)

Bases: oslo_service.loopingcall.LoopingCallBase

A fixed interval looping call.

start(interval, initial_delay=None, stop_on_exception=True)
class oslo_service.loopingcall.LoopingCallBase(f=None, *args, **kw)

Bases: object

stop()
wait()
exception oslo_service.loopingcall.LoopingCallDone(retvalue=True)

Bases: exceptions.Exception

Exception to break out and stop a LoopingCallBase.

The poll-function passed to LoopingCallBase can raise this exception to break out of the loop normally. This is somewhat analogous to StopIteration.

An optional return-value can be included as the argument to the exception; this return-value will be returned by LoopingCallBase.wait()

class oslo_service.loopingcall.RetryDecorator(max_retry_count=-1, inc_sleep_time=10, max_sleep_time=60, exceptions=())

Bases: object

Decorator for retrying a function upon suggested exceptions.

The decorated function is retried for the given number of times, and the sleep time between the retries is incremented until max sleep time is reached. If the max retry count is set to -1, then the decorated function is invoked indefinitely until an exception is thrown, and the caught exception is not in the list of suggested exceptions.

Previous topic

eventlet_backdoor

Next topic

periodic_task

This Page