Hello, I am using Futures to return promises of results of a thread. But is it possible to 'fork' the execution of the function to execute a snippet of code just after finishing the thread? Here's the idea of the code.
public Future invoke_async(Map<Object, Object> params) {
Funtion <Map<Object,Object>, Object> action = foo.getAction();
Callable<Object> callable = () -> action.apply(params);
ExecutorService executorService = Executors.newSingleThreadExecutor();
Future future = executorService.submit(callable);
//Here I would run a snippet of code after finishing the thread
return future;
}```
