Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Handling long running validation

Hi Chris,

Perhaps the examples in our docs don't make this clear, but every service method call is async under the hood, and thus potentially long-running. To take advantage of this, make your service method return a Deferred object (which eventually resolves with the validation result, outline, or whatever) and it should just work.

Here's an example of such a service:
http://github.com/eclipse/orion.client/blob/master/bundles/org.eclipse.orion.client.core/web/plugins/asyncUpperPlugin.html
(note that use of dojo's Deferred is not required -- any "then-able" object will do.)

This section of the Developer Guide explains more about services.

Mark

On Tue, Jul 10, 2012 at 11:00 AM, Chris Whitty <chris.whitty@xxxxxxxxxxxxxx> wrote:

Hi all,

 

Apologies if I am missing something obvious here. I have a validator and outliner that make relatively long running xhr requests to a server. I would like this to happen asynchronously but I can't work out how to do this as when the service I registered is called, it seems to be expected to return synchronously. Is there a way to either trigger the rest of the validation myself when the request returns or to return a dojo deferred object  which Orion can call then() on?

 

Thanks,

Chris.

 


Please consider the environment before printing this e-mail.

This message has been scanned by MailController.

 


_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



Back to the top