The cinder.taskflow.utils Module

class FlowFailure(runner, flow, exception)

Bases: object

When a task failure occurs the following object will be given to revert and can be used to interrogate what caused the failure.

class LastFedIter(first, rest_itr)

Bases: object

An iterator which yields back the first item and then yields back results from the provided iterator.

class LazyPluggable(pivot, **backends)

Bases: object

A pluggable backend loaded lazily based on some value.

class ReaderWriterLock

Bases: object

A simple reader-writer lock.

Several readers can hold the lock simultaneously, and only one writer. Write locks have priority over reads to prevent write starvation.

Public domain @ http://majid.info/blog/a-reader-writer-lock-for-python/

acquire(*args, **kwds)

Acquire a read or write lock in a context manager.

acquire_read()

Acquire a read lock.

Several threads can hold this typeof lock. It is exclusive with write locks.

acquire_write()

Acquire a write lock.

Only one thread can hold this lock, and only when no read locks are also held.

release()

Release a lock, whether read or write.

class RollbackAccumulator

Bases: object

A utility class that can help in organizing ‘undo’ like code so that said code be rolled back on failure (automatically or manually) by activating rollback callables that were inserted during said codes progression.

add(*callables)
reset()
rollback(cause)
class RollbackTask(context, task, result)

Bases: object

A helper task that on being called will call the underlying callable tasks revert method (if said method exists).

class Runner(task, uuid=None)

Bases: object

A helper class that wraps a task and can find the needed inputs for the task to run, as well as providing a uuid and other useful functionality for users of the task.

TODO(harlowja): replace with the task details object or a subclass of that???

name
optional
provides
requires
reset()
uuid
version
class TransitionNotifier

Bases: object

A utility helper class that can be used to subscribe to notifications of events occuring as well as allow a entity to post said notifications to subscribers.

ANY = '*'
RESERVED_KEYS = ('details',)
deregister(state, callback)
notify(state, details)
register(state, callback, args=None, kwargs=None)
reset()
await(check_functor, timeout=None)
get_attr(task, field, default=None)
get_many_attr(obj, *attrs)
get_task_name(task)

Gets a tasks string name, whether it is a task object/function.

get_task_version(task)

Gets a tasks string version, whether it is a task object/function.

is_version_compatible(version_1, version_2)

Checks for major version compatibility of two *string” versions.

join(itr, with_what=', ')

Previous topic

The cinder.taskflow.task Module

Next topic

The cinder.test Module

This Page