• Post Reply Bookmark Topic Watch Topic
  • New Topic

future.cancel(true) Vs future.cancel(false)  RSS feed

 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which one ( future.cancel(true) / future.cancel(false) ) cancel the task and start the scheduler again without interruption.


scheduledFuture = scheduledExecutorService.scheduledWithFixedDelay(task, delay, delay, TimeUnit.SECONDS);
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37252
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you expect cancel() to run the task again?
 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to cancel the current task and run the scheduler again with different delay during runtime.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!