开发者

Is there a library in java that can accept future task? [closed]

开发者 https://www.devze.com 2023-02-16 22:17 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site r开发者_JAVA技巧esource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

I am looking for java library or open source that will do the following: Accept a Runnable task, and a specific time to execute it in the future, and execute it then. Do you know such?


You can use the java.util.Timer class to run a java.util.TimerTask. TimerTask imlements the Runnable interface


You mean something like scheduler? Try Quartz (doesn't use Runnable but Job).

Or try Java's ScheduledThreadPoolExecutor.


Its already there in your standard JDK: TimerTask


I'm not sure if it's the software or the code you need but if it's just running a task you need then you could probably use CRON for *nix based systems and Task Scheduler for Windows.

0

精彩评论

暂无评论...
验证码 换一张
取 消