Skip to content

Instantly share code, notes, and snippets.

@exhesham
Created October 21, 2018 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exhesham/8b32aedaa5a0b23b0afe4e6dc5072148 to your computer and use it in GitHub Desktop.
Save exhesham/8b32aedaa5a0b23b0afe4e6dc5072148 to your computer and use it in GitHub Desktop.
public class RunnableJob implements Runnable{
@Override
public void run() {
}
}
public void runJobs(){
CompletableFuture<Void> f = CompletableFuture.runAsync(new RunnableJob());
f.thenRun(new RunnableJob());
CompletableFuture<RunnableJob> f2 = CompletableFuture.supplyAsync(()->new RunnableJob());
f2.thenRun(new RunnableJob());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment