System-level utilities and helper functions.
-
class heat.common.utils.LoopingCall(f=None, *args, **kw)[source]
Bases: object
-
start(interval, now=True)[source]
-
stop()[source]
-
wait()[source]
-
exception heat.common.utils.LoopingCallDone(retvalue=True)[source]
Bases: exceptions.Exception
Exception to break out and stop a LoopingCall.
The poll-function passed to LoopingCall 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 LoopingCall.wait()
-
heat.common.utils.chunkiter(fp, chunk_size=65536)[source]
Return an iterator to a file-like obj which yields fixed size chunks
Parameters: |
- fp – a file-like object
- chunk_size – maximum size of chunk
|
-
heat.common.utils.chunkreadable(iter, chunk_size=65536)[source]
Wrap a readable iterator with a reader yielding chunks of
a preferred size, otherwise leave iterator unchanged.
Parameters: |
- iter – an iter which may also be readable
- chunk_size – maximum size of chunk
|