I have a specific requirement.
I have a notification functionality which sends the email to all the systems clients. The code is written in java.
What i want to
Why not use a ScheduledThreadPoolExecutor which allows you to schedule tasks to execute in future.
ScheduledExecutorService scheduledExecutorService =
Executors.newScheduledThreadPool(5);
ScheduledFuture scheduledFuture =
scheduledExecutorService.schedule(new Callable() {
public Object call() throws Exception {
System.out.println("Executed!");
return "Called!";
}
},
5,
TimeUnit.SECONDS);
use scheduling and take a look here