<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Manuel,
<div class=""><br class="">
</div>
<div class="">when the command is finished, 'loop' will return immediately.</div>
<div class=""><br class="">
</div>
<div class="">Alternatively you can also use 'block' instead. 'block' lets you specify a maximum time </div>
<div class="">you want to wait for the command to finish. 'loop' is the same, you can just have a bit </div>
<div class="">more feedback of what time has passed. Both will return immediately when the command </div>
<div class="">is finished.</div>
<div class=""><br class="">
</div>
<div class="">There's no need for Thread.sleep() etc.</div>
<div class=""><br class="">
</div>
<div class="">Hope that makes it a bit clearer.</div>
<div class=""><br class="">
</div>
<div class="">See also the Docs for the CmdCallback interface:</div>
<div class=""> <a href="http://downloads.openmicroscopy.org/omero/5.4.0/api/omero/cmd/CmdCallbackI.html" class="">http://downloads.openmicroscopy.org/omero/5.4.0/api/omero/cmd/CmdCallbackI.html</a> </div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Dominik</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 24 Oct 2017, at 12:51, Manuel Stritt <<a href="mailto:manuel.stritt@idorsia.com" class="">manuel.stritt@idorsia.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class=""><br class="">
<div class="">Dear all,</div>
<div class=""><br class="">
</div>
<div class="">I'm wondering what's the correct way to handle async callbacks, e.g. deleting an object, as a non-async call</div>
<div class="">(wait until the command has been executed).</div>
<div class=""><br class="">
</div>
<div class="">The docu for deleting an object:</div>
<div class=""><a href="https://docs.openmicroscopy.org/omero/5.4.0/developers/Java.html#delete-data" class="">https://docs.openmicroscopy.org/omero/5.4.0/developers/Java.html#delete-data</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">calls loop(10,500) to wait until it is finished. </div>
<div class="">- why do you wait 10 times 500 and not one time 5000 ?</div>
<div class="">- if the call is finished after a few loops, will it still do the other waits?</div>
<div class="">- is there a guaranty that after the loop call the command has been finished?</div>
<div class=""><br class="">
</div>
<div class="">My goal is to wait until the call is finished.</div>
<div class="">What about <a href="http://s.th/" class="">s.th</a>. like</div>
<div class=""><br class="">
</div>
<div class="">CmdCallbackI callback = dm.delete(context, object);<br class="">
</div>
<div class="">while (callback.getResponse()!=null) {</div>
<div class=""> Thread.sleep(100);</div>
<div class="">}</div>
<div class="">?</div>
<div class=""><br class="">
</div>
<div class="">Thanks for your help!</div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Manuel</div>
<div class=""><br class="">
</div>
</div>
<br class="">
<div class=""><br class="">
</div>
<div class="">
<div class=""><font size="2" class="">The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.</font></div>
<div class=""><font size="2" class="">It is intended solely for the addressee. If you are not the intended recipient, any copying, distribution or any other use of this email is prohibited and may be unlawful. In such case, you should please notify the sender
immediately and destroy this email.</font></div>
<div class=""><font size="2" class="">The content of this email is not legally binding unless confirmed by letter.</font></div>
<div class=""><font size="2" class="">Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of the sender's company.</font></div>
</div>
_______________________________________________<br class="">
ome-devel mailing list<br class="">
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" class="">ome-devel@lists.openmicroscopy.org.uk</a><br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>