Comment 4 for bug 1352550

Revision history for this message
Joshua Harlow (harlowja) wrote :

Also note that if u use the following as a context manager this will be done for u.

https://github.com/openstack/taskflow/blob/master/taskflow/persistence/backends/__init__.py#L72

This would work as follows:

with backend.backend(conf) as backend:
    store = { ... }
    flow = get_my_flow()
    engine = engines.load(flow,
                          engine_conf=engine_conf,
                          store=store,
                          backend=backend)
    engine.run()
    ....