Announcement Announcement Module
Collapse
No announcement yet.
Remove a task from a scheduler Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    Hello everybody

    Is there any spring scheduler implementation that supports my use case? Maybe any alternatives?

    Thanks,
    Marco

    Comment


    • #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

      Comment

      Working...
      X