System-level utilities and helper functions.
Bases: object
An eventlet thread friendly class for reading in image data.
When accessing data either through the iterator or the read method we perform a sleep to allow a co-operative yield. When there is more than one image being uploaded/downloaded this prevents eventlet thread starvation, ie allows all threads to be scheduled periodically rather than having the same thread be continuously active.
Return the next chunk of the underlying iterator.
This is replaced with cooperative_read in __init__ if the underlying fd already supports read().
Return an iterator to a file-like obj which yields fixed size chunks
Parameters: |
|
---|
Wrap a readable iterator with a reader yielding chunks of a preferred size, otherwise leave iterator unchanged.
Parameters: |
|
---|
Return an iterator which schedules after each iteration. This can prevent eventlet thread starvation.
Parameters: | iter – an iterator to wrap |
---|
Wrap a file descriptor’s read with a partial function which schedules after each read. This can prevent eventlet thread starvation.
Parameters: | fd – a file descriptor to wrap |
---|
Returns validation of a value as a UUID.
For our purposes, a UUID is a canonical form string: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa