Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wait multiple tasks to finish.

 
Byeonggon Lee
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to make a JavaFX program that send multiple HTTP GET requests simultaneously without stopping main(UI) thread. After all requests are finished, the program should update its status Text to "finished".

if I would send only a single request that is easy like this:

But what I'm trying to do is sending multiple requests and setting status Text after ALL requests are finished.
What is the best way to achieve this?
 
Paul Clapham
Sheriff
Posts: 21572
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all you won't want to use Thread objects and write your own thread pool. Here's a link to Oracle's tutorial about thread pooling features which are built into the language: Thread Pools.

And as for how to do that without blocking the UI, there's a standard way to do that in JavaFX too. Here's a link to Oracle's tutorial about that: Concurrency in JavaFX.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic