[openstack-dev] Future-based api for openstack clients calls, that starts background tasks

Konstantin Danilov kdanilov at mirantis.com
Mon Jan 12 11:30:23 UTC 2015

Hi all.

There a set of openstack api functions which starts background actions
and return preliminary results - like 'novaclient.create'. Those functions
requires periodically check results and handle timeouts/errors
(and often cleanup + restart help to fix an error).

Check/retry/cleanup code duplicated over a lot of core projects.
As examples - heat, tempest, rally, etc and definitely in many third-party

I propose to provide common higth-level API for such functions, which uses
'futures' (http://en.wikipedia.org/wiki/Futures_and_promises) as a way to
present background task.

Idea is to add to each background-task-starter function a complimentary
that returns 'future' object. E.g.

    create_future = novaclient.servers.create_async(....)
    vm = create_future.result()

This allows to unify(and optimize) monitoring cycles, retries, etc.
Please found complete BP at

Kostiantyn Danilov aka koder <http://koder.ua>
Principal software engineer, Mirantis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150112/4012e18b/attachment.html>

More information about the OpenStack-dev mailing list