<div dir="ltr">Konstantin,<div><br></div><div><br></div><div>I believe it's better to work on server side, and use some modern approach like web sockets for async operations. So we won't need to retrieve 100500 times information about object. And then use this feature in clients. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:13px"> create_future = novaclient.servers.create_</span><span style="font-size:13px">async(....)<br></span><span style="font-size:13px"> .....<br></span><span style="font-size:13px"> vm = create_future.result()</span></blockquote><div><br></div><div>As well this pattern doesn't look great. </div><div><br></div><div>I would prefer to see something like: </div><div><br></div><div> vm = novaclient.servers.create(...., sync=True)</div><div><br></div><div><br></div><div>Best regards,</div><div>Boris Pavlovic </div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 12, 2015 at 2:30 PM, Konstantin Danilov <span dir="ltr"><<a href="mailto:kdanilov@mirantis.com" target="_blank">kdanilov@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi all.<br></div><div><br>There a set of openstack api functions which starts background actions<br>and return preliminary results - like 'novaclient.create'. Those functions<br>requires periodically check results and handle timeouts/errors<br>(and often cleanup + restart help to fix an error).<br><br>Check/retry/cleanup code duplicated over a lot of core projects.<br>As examples - heat, tempest, rally, etc and definitely in many third-party scripts.<br><br>I propose to provide common higth-level API for such functions, which uses<br>'futures' (<a href="http://en.wikipedia.org/wiki/Futures_and_promises" target="_blank">http://en.wikipedia.org/wiki/Futures_and_promises</a>) as a way to<br>present background task.<br><br>Idea is to add to each background-task-starter function a complimentary call,<br>that returns 'future' object. E.g.<br><br> create_future = novaclient.servers.create_async(....)<br> .....<br> vm = create_future.result()<br><br>This allows to unify(and optimize) monitoring cycles, retries, etc.<br>Please found complete BP at<br><a href="https://github.com/koder-ua/os_api/blob/master/README.md" target="_blank">https://github.com/koder-ua/os_api/blob/master/README.md</a><br><br clear="all"></div>Thanks<span class="HOEnZb"><font color="#888888"><br><div>-- <br><div>Kostiantyn Danilov aka <a href="http://koder.ua" target="_blank">koder</a><br>Principal software engineer, Mirantis<br><br>skype:<a href="http://koder.ua" target="_blank">koder.ua</a><br><a href="http://koder-ua.blogspot.com/" target="_blank">http://koder-ua.blogspot.com/</a><br><a href="http://mirantis.com" target="_blank">http://mirantis.com</a></div>
</div></font></span></div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>