• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make performance feasible in a method  RSS feed

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

i have method , in that i am calling two external services , the thing is these two services are independent , i am getting response very lately from these services, How can i call these two services parallely to
decrease the response time from those services, i am using theses responses in the rest of the programme

Thanks Regards
Raj
 
Ranch Hand
Posts: 117
Chrome Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
raj talatam wrote:Hi all,

i have method , in that i am calling two external services , the thing is these two services are independent , i am getting response very lately from these services, How can i call these two services parallel y to
decease the response time from those services, i am using theses responses in the rest of the programme

Thanks Regards
Raj


Hello Raj,

Use threads, read up on them here..

 
raj talatam
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,
i can use threads, i am going to end up with this scenario with two separate classes, which extend Thread/ Runnable , but scenario here is they are just service calls , and they are taking large amount of time
. i need a solution which process these two service calls should run parallel.
thanks
raj
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
raj talatam wrote:
i can use threads, i am going to end up with this scenario with two separate classes, which extend Thread/ Runnable , but scenario here is they are just service calls , and they are taking large amount of time
. i need a solution which process these two service calls should run parallel.
thanks
raj


Not sure what you are saying here... Are you in agreement and saying that you will use threads? Or are you saying that you don't want to?

Henry
 
Ranch Hand
Posts: 172
Java MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on the tonality of OP statement, it seems to me that he means, "Yes, he is aware of the Thread mechanism and that is one plausibility, but since they are just service call's then is there any other method besides the usual threading stuff"...
 
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect what the OP is after is a way to do this without having to directly deal with threads in which case I would suggest looking at the Executor services. There's a tutorial here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!