Executors in the Middle Ages |
Callable
and Future
to demonstrate the concurrency libraries in Java.In the example, I use a
ExecutorService
with a fixed thread pool size of two (2), to make the code slower to demonstrate the point. You can manipulate the value to see the effect on the code execution.The code is to demonstrate you can do it, there may be other cleaner ways of doing this. If you have an example, or idea on how to do it cleaner, please comment. :-)
Solution
The code for the project was developed using NetBeans and can be downloaded from Bitbucket at the link below. It is a NetBeans (Apache Ant) based project and should work with Ant without NetBeans.CallOrderCancel
No comments:
Post a Comment