<div dir="ltr">Hi <span style="font-size:12.8px">Dominik,</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">ok loop() does the job for me. Thanks for the fast help!</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Regards,</span></div><div><span style="font-size:12.8px">Manuel</span></div><div><div class="gmail_extra"><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="word-wrap:break-word">
Hi Manuel,
<div><br>
</div>
<div>when the command is finished, 'loop' will return immediately.</div>
<div><br>
</div>
<div>Alternatively you can also use 'block' instead. 'block' lets you specify a maximum time </div>
<div>you want to wait for the command to finish. 'loop' is the same, you can just have a bit </div>
<div>more feedback of what time has passed. Both will return immediately when the command </div>
<div>is finished.</div>
<div><br>
</div>
<div>There's no need for Thread.sleep() etc.</div>
<div><br>
</div>
<div>Hope that makes it a bit clearer.</div>
<div><br>
</div>
<div>See also the Docs for the CmdCallback interface:</div>
<div> <a href="http://downloads.openmicroscopy.org/omero/5.4.0/api/omero/cmd/CmdCallbackI.html" target="_blank">http://downloads.<wbr>openmicroscopy.org/omero/5.4.<wbr>0/api/omero/cmd/CmdCallbackI.<wbr>html</a> </div>
<div><br>
</div>
<div>Regards,</div>
<div>Dominik</div>
<div><br>
</div>
<div>
<div>
<blockquote type="cite">
<div>On 24 Oct 2017, at 12:51, Manuel Stritt <<a href="mailto:manuel.stritt@idorsia.com" target="_blank">manuel.stritt@idorsia.com</a>> wrote:</div>
<br class="gmail-m_-2504664964980250095Apple-interchange-newline">
<div>
<div dir="ltr"><br>
<div>Dear all,</div>
<div><br>
</div>
<div>I'm wondering what's the correct way to handle async callbacks, e.g. deleting an object, as a non-async call</div>
<div>(wait until the command has been executed).</div>
<div><br>
</div>
<div>The docu for deleting an object:</div>
<div><a href="https://docs.openmicroscopy.org/omero/5.4.0/developers/Java.html#delete-data" target="_blank">https://docs.openmicroscopy.<wbr>org/omero/5.4.0/developers/<wbr>Java.html#delete-data</a><br>
</div>
<div><br>
</div>
<div>calls loop(10,500) to wait until it is finished. </div>
<div>- why do you wait 10 times 500 and not one time 5000 ?</div>
<div>- if the call is finished after a few loops, will it still do the other waits?</div>
<div>- is there a guaranty that after the loop call the command has been finished?</div>
<div><br>
</div>
<div>My goal is to wait until the call is finished.</div>
<div>What about <a href="http://s.th/" target="_blank">s.th</a>. like</div>
<div><br>
</div>
<div>CmdCallbackI callback = dm.delete(context, object);<br>
</div>
<div>while (callback.getResponse()!=null) {</div>
<div>  Thread.sleep(100);</div>
<div>}</div>
<div>?</div>
<div><br>
</div>
<div>Thanks for your help!</div>
<div><br>
</div>
<div>Regards,</div>
<div>Manuel</div>
<div><br>
</div>
</div>
<br>
<div><br>
</div>
<div>
<div><font size="2">The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.</font></div>
<div><font size="2">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><font size="2">The content of this email is not legally binding unless confirmed by letter.</font></div>
<div><font size="2">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>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.<wbr>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.<wbr>org.uk/mailman/listinfo/ome-<wbr>devel</a><br>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<span style="font-size:10pt">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div>

<br>______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.<wbr>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.<wbr>org.uk/mailman/listinfo/ome-<wbr>devel</a><br>
<br></blockquote></div><br><br>
</div></div></div>

<br>
<div><br></div><div><div><font size="2">The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.</font></div><div><font size="2">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><font size="2">The content of this email is not legally binding unless confirmed by letter.</font></div><div><font size="2">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>