[ome-devel] async callbacks in blitz 5.4.x

Dominik Lindner (Staff) d.lindner at dundee.ac.uk
Wed Oct 25 13:37:06 BST 2017


Hi Manuel,

when the command is finished, 'loop' will return immediately.

Alternatively you can also use 'block' instead. 'block' lets you specify a maximum time
you want to wait for the command to finish. 'loop' is the same, you can just have a bit
more feedback of what time has passed. Both will return immediately when the command
is finished.

There's no need for Thread.sleep() etc.

Hope that makes it a bit clearer.

See also the Docs for the CmdCallback interface:
 http://downloads.openmicroscopy.org/omero/5.4.0/api/omero/cmd/CmdCallbackI.html

Regards,
Dominik

On 24 Oct 2017, at 12:51, Manuel Stritt <manuel.stritt at idorsia.com<mailto:manuel.stritt at idorsia.com>> wrote:


Dear all,

I'm wondering what's the correct way to handle async callbacks, e.g. deleting an object, as a non-async call
(wait until the command has been executed).

The docu for deleting an object:
https://docs.openmicroscopy.org/omero/5.4.0/developers/Java.html#delete-data

calls loop(10,500) to wait until it is finished.
- why do you wait 10 times 500 and not one time 5000 ?
- if the call is finished after a few loops, will it still do the other waits?
- is there a guaranty that after the loop call the command has been finished?

My goal is to wait until the call is finished.
What about s.th<http://s.th/>. like

CmdCallbackI callback = dm.delete(context, object);
while (callback.getResponse()!=null) {
  Thread.sleep(100);
}
?

Thanks for your help!

Regards,
Manuel



The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.
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.
The content of this email is not legally binding unless confirmed by letter.
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.
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20171025/795bc57b/attachment.html>


More information about the ome-devel mailing list