阅读背景:

如何使用java中的ScheduledExecutorService在固定的时间间隔调用可调用的实现?

来源:互联网 

ScheduledExecutorService has methods like scheduleAtFixedRate(Runnable command,long initialDelay,long period,TimeUnit unit) to invoke Runnable classes at fixed intervals. I want my Thread to return some value after execution. So I implemented Callable interface. I could not find an equivalent method for invoking my Callable class at regular interval. Is there any other way to implement this? If this is functionality is not provided by Java, what is the rational behind that decision? Please let me know. Thanks.ScheduledExecutorService has methods like sched




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: