dont need the future object if you have to forget it i.e. dont care about the future of the thread. :)
ExecutorService executor = Executors.newSingleThreadExecutor();
public void push(Callable<Boolean> task) {
executor.submit(task);
}
or if you need to use future some time later than :-
ExecutorService executor = Executors.newSingleThreadExecutor();
public void push(Callable<Boolean> task) {
someCollection.add(executor.submit(task)); // use futures later
}
or just use execute from Executor and pass Runnable, if you dont intent to get the future at all.
ExecutorService executor = Executors.newSingleThreadExecutor();
public void push(Runnable task) {
executor.execute(task);
}
// execute will invoke default exceptional handler in case of exception, that can be lost in case if you dont get hold of futures in submit method.