Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SceduledExecutorService  RSS feed

 
Vinod Awar
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiii ranchers,

can anybody please explain me how to use the java.util.concurrent.ScheduledExecutorService interface?

Thanks,
Vinod.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vinod awar:
can anybody please explain me how to use the java.util.concurrent.ScheduledExecutorService interface?


"How to use" means you can not determine which class implements this OR you are confused about what it does?

You can get an instance of the interface from the factory method newScheduledThreadPool() in java.util.concurrent.Executors class OR you can directly use a ScheduledThreadPoolExecutor.
This is used when you want to do something similar to Timer i.e. run a task after a fixed duration of time. The difference being that it employes multiple threads(core pool size) to run the scheduled tasks. Javadoc of the interface will give you a code example and detail of what it does.
 
Vinod Awar
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nitesh
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!