RTC Forums
May 21, 2024, 03:10:46 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: rtcHTTPClient and REST  (Read 3963 times)
ClementDoss
RTC License
***
Posts: 36


« on: December 01, 2015, 03:53:15 PM »

Hi,

I'm working on a rtc REST server and I need a better understanding of how I should write my ClientApp to connect the best way. I want to use the least resources while keeping optimal performance. I don't want the client app to stop being responsive.
How should I design in a multi-threaded client application. For example: Let's say there are 2 forms in my client application. Each of them need to request some data from the server:
1) Can I centralize rtcHTTPClient? In that case, is it possible to use only one rtcHTTPclient for the entire application? Is there a need for rtcHTTPClient Pool?
Or
2) Should every form has it own rtcHTTPClient

Do you have an example or some articles to suggest?

TIA,
Clément

Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: December 01, 2015, 10:39:57 PM »

There is no "one-for-all" answer to that question. It all depends on your Applications requirements. While a single TRtcHttpClient will be enough for most Applications working with a single Server, you would need a separate TRtcHttpClient component if your Client has to periodically poll the Server for data, like in the RTC Messenger Client and Server Demos. Also, please note tha using more connections does not automatically give you better response, if all your connections will be sharing the same bandwidth and talking to the same Server.

Best Regards,
Danijel Tkalcec
Logged
ClementDoss
RTC License
***
Posts: 36


« Reply #2 on: December 05, 2015, 04:23:42 PM »


Sorry for taking so long to answer...

There will be one client application, and one server application. The client application will not use modal windows. Every "Toolbutton" on the client form will be linked to an "action" (ex: /customer/function/1234). Some actions might return a dataset with a few rows ( less then 50 ). Some actions will instruct the server to perform some update or delete. For those, the server will return immediately while all the work is done in the background.
Since the user can click one button at a time, I'm considering to have only one rtcHttpClient for the entire client application. The calls to the server should be very quick for most forms on the application. For the forms that might request more data and that might take some time to return,  I'll use another rtcHTTPclient.

The application will deal with customer, suppliers, orders, etc. For now I don't think "RTC messenger like" will be needed, although it is quite possible to implement such messenger in a future release.

TIA,
Clément

Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: December 06, 2015, 07:54:49 PM »

Sounds like you've answered your question Smiley

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 17 queries.