-
Jun 9th, 2011, 05:42 AM
#1
Remove a task from a scheduler
Hello everybody
I have a ThreadPoolTaskScheduler which schedules a lot of tasks. At random time, I have to remove one of this task without destroying the whole scheduler. How do I do that? I can't find a way to call something like remove(myRunnable). Maybe I use a schedule in a way it isn't designed for.
Regards,
Marco
-
Jun 20th, 2011, 09:16 AM
#2
Hello everybody
Is there any spring scheduler implementation that supports my use case? Maybe any alternatives?
Thanks,
Marco
-
Jun 22nd, 2011, 01:49 AM
#3
Hello everybody
For all of those who are interested in a working solution: If you use any of the schedule() methods, you can use the returned ScheduledFuture to manage the lifecycle of a task. It would be useful if there may be a section in the documentation [1] which explains this topic such as:
"The lifecycle of the scheduled tasks can be managed over the returned ScheduledFuture. F.ex. for cancelling and termination".
[1] http://static.springsource.org/sprin...task-scheduler
Regards,
Marco
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules