Locking

To avoid raise conditions on update viewflow.flow.flow_view() and viewflow.flow.flow_job() decoratos grabs process-instance wide locks and instansiate database transaction.

You could specify selected lock implementation in :attr:lock_impl of viewflow.base.Flow class

viewflow.lock.no_lock(flow)

No pessimistic locking, just execute flow task in transaction. Not suitable when you have Join nodes in your flow.

viewflow.lock.select_for_update_lock(flow, nowait=True, attempts=5)

Uses select ... for update on process instance row for locking, bound to database transaction.

Recommended for use with PostgreSQL.

viewflow.lock.cache_lock(flow, attempts=5, expires=120)

Use it if primary cache backend has transactional add functionality, like memcached.