How to delay a method call dynamically?

With regard to the question how to delay a method call, R1 is worthy to have a look. My problem is, the delay would change, some tasks has higher priority should be executed immediately, this would have impact on already scheduled ones. Another problem, the delay is not unlimited, too long delay like 10 seconds would be extremely unpleasant for web users.

Relavant interfaces/classes:

ScheduledExecutorService

Timer

Handler

TO BE CONTINUED

Reference 1: http://stackoverflow.com/questions/3072173/how-to-call-a-method-after-a-delay

你可能感兴趣的:(How to delay a method call dynamically?)