Asynch/Await

Forum to discuss the new web client version of Servoy.

Asynch/Await

Postby marco.rossi » Tue Oct 06, 2020 5:46 pm

Good morning,
does exist a way of doing an Asynch/Await call in Servoy-NGClient without building an Angular plugin?

best regards

Marco
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 110
Joined: Sun Apr 12, 2015 9:33 pm

Re: Asynch/Await

Postby paronne » Fri Oct 30, 2020 5:32 pm

Hi Marco,

what are you really trying to achieve with Asynch/Await call ?
If you are looking into performing an heavy background operation you can still make use of the headless client to perform an heavy task async.

Regards,
Paolo
paronne
 
Posts: 202
Joined: Fri Nov 02, 2012 3:21 pm

Re: Asynch/Await

Postby marco.rossi » Fri Oct 30, 2020 7:35 pm

Hi Paolo,
thank you for your reply.

I know the headless client but there are several cases in which one could have the necessity to work in an asynch way (ex: when you call external APIs or while you're in the middle of an huge refactor and you want to give to the user a better experience).

Can Servoy achieve that?
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 110
Joined: Sun Apr 12, 2015 9:33 pm

Re: Asynch/Await

Postby paronne » Mon Nov 02, 2020 9:35 am

Hi Marco,

sure, is possible to execute async API request since some time already.
Using the HTTP plugin you can executeAsyncRequest. Check https://wiki.servoy.com/display/DOCS/Ge ... kExtraArgs)

Regards,
Paolo
paronne
 
Posts: 202
Joined: Fri Nov 02, 2012 3:21 pm

Re: Asynch/Await

Postby marco.rossi » Mon Nov 02, 2020 5:10 pm

Hi Paolo,
thank you again for your last reply.
I was aware about the "http" plugin to interrogate an external API but this doesn't allow me (as far as I know) to perform a real Asynch/Await with a servoy function.

Example: I have a form with 5 divs within. I have to fill each div with some data taken by running some db functions. Two functions are very slow and what I would like
to get is a way to launch their execution in an asynch way.

In this way, I would optimize the time that the user has to wait to get the whole screen loaded.

I know that the db should be built in order to avoid this kind of scenarios but it's not always possible, especially when you're called to refactor an old system.
That's why I'm asking if Servoy is able to do an Asynch/Await.

Apart of all the considerations and the specific needs, the final question remains: is Servoy able to do that?
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 110
Joined: Sun Apr 12, 2015 9:33 pm

Re: Asynch/Await

Postby paronne » Thu Nov 05, 2020 12:08 pm

Hi Marco,

feels you want to show some KPI/Stats as result of complex/slow queries ?
the examples you describe i would have solve them using an headless client and update the UI async as soon i get a response from the headless.

As far i know there is no actual Asynch/Await constructor to be used; that's has been only introduced in the later 8th generation of the ECMAScript.
Can't tell if there is a Java equivalent pattern for that.

Regards,
Paolo
paronne
 
Posts: 202
Joined: Fri Nov 02, 2012 3:21 pm

Re: Asynch/Await

Postby marco.rossi » Tue Nov 10, 2020 3:50 pm

Hi Paolo,
thank you for your answer and your time.
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 110
Joined: Sun Apr 12, 2015 9:33 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 8 guests