HeadlessClient questions

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

HeadlessClient questions

Postby jasantana » Sun Jul 03, 2011 2:04 pm

I have a process in my solution that running from SmartClient takes about 7 minutes. It´s just a loop on a foundset that creates records in another foundset.

Due to that performance issue with SmartClient I have been adviced to use a headlessclient that runs that process at the server side.´That´s good and seems to be a great option because after some tests I see the speed is good enough.

Of course those tests were in sample data tables and not in real tables and here are where the doubts arise.

My tables have a tenantID field that has an autoenter value base on a global variable that is set when the user logins. I will have to pass those variables to the headlessclient and set them into that solution variables so it can work, am I right? Where are those parameters received in the headlessclient solution?

Now think that I create one headlessclient per solution and two different tenants run a process, the same or different process in that HLC solution, what would happen with those global variables, will each user have its own value or they will have the same value?

Is there a way to know where the process is? I see there is a callback function that is called when the process finishes, but can I check how the process is doing to show the user a progress of it?

Thanks.
Best regards,
Juan Antonio Santana Medina
[email protected]
EAGER BEAVER 2011
EAGER BEAVER 2012
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 540
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: HeadlessClient questions

Postby ROCLASI » Sun Jul 03, 2011 6:25 pm

Hi Juan,

Unless I am really mistaken (Servoyans please correct me if I am wrong)...
Headless clients spawn from your SmartClient are bound to your session. So each SmartClient will spawn it's own headless client.
So if you have 10 users on your system and they all hit that method to process your method in a headless client at the same time you will be using 20 clients, 10 SmartClients and 10 headless clients.
So any globals that are set in that headless client session is yours, no other user will be using that.

As far as the feedback concerns, the headless client only has a callback method for when it finished or has an exception. So if you want some feedback you need to store some data in a table for that specific session and let the your SmartClient monitor that (if you do that right then Servoy's data-broadcasting will take care of the updating for that).

Hope this helps.
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5205
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: HeadlessClient questions

Postby jasantana » Sun Jul 03, 2011 6:41 pm

Hi Robert. Thanks for your answer.

The solution to monitor the process status sounds great.

About how many SHC are created will depend on the command. If I only create one clent and store its ID somewhere where the clients can get it I could also enqueue methods even that clien did not create that SHC. Am I right?
Best regards,
Juan Antonio Santana Medina
[email protected]
EAGER BEAVER 2011
EAGER BEAVER 2012
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 540
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: HeadlessClient questions

Postby ROCLASI » Sun Jul 03, 2011 7:02 pm

jasantana wrote:About how many SHC are created will depend on the command. If I only create one clent and store its ID somewhere where the clients can get it I could also enqueue methods even that clien did not create that SHC. Am I right?

Good point, and although I haven't played with this functionality yet I think you are right.
I would say, test it! :)
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5205
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: HeadlessClient questions

Postby jasantana » Sun Jul 03, 2011 9:08 pm

Hi Robert. I will try and let you know.

By the way, could you please explain me where the parameters are received in the headlessclient?

I mean when you do var headlessClient = plugins.headlessclient.createClient("someSolution", "user", "pass", aArgs);

Thanks.
Best regards,
Juan Antonio Santana Medina
[email protected]
EAGER BEAVER 2011
EAGER BEAVER 2012
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 540
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: HeadlessClient questions

Postby ROCLASI » Sun Jul 03, 2011 9:24 pm

Hi Juan,

The arguments are passed to the onOpen event. Same as with arguments passed to a batch processor (which is a headless client).
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5205
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: HeadlessClient questions

Postby jasantana » Sun Jul 03, 2011 9:59 pm

Thanks Robert now I see it.

The problem is that I expected parameters in the onOpen event of the opened solution not the one that is creating the SHC.

That is beacuse I created a solution to hold all the functions that I could need and I thought that the onSolution event that was triggered was its own.

Thanks.
Best regards,
Juan Antonio Santana Medina
[email protected]
EAGER BEAVER 2011
EAGER BEAVER 2012
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 540
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom


Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 1 guest

cron