Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
kri shan
Ranch Hand
Posts: 1486
  • 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: 35762
412
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: 1486
  • 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.

 
Don't touch me. And dont' touch this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!