Results 1 to 3 of 3

Thread: Remove a task from a scheduler

  1. #1
    Join Date
    Mar 2011
    Posts
    8

    Default 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. #2
    Join Date
    Mar 2011
    Posts
    8

    Default

    Hello everybody

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

    Thanks,
    Marco

  3. #3
    Join Date
    Mar 2011
    Posts
    8

    Default

    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
  •