Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Gracefull Shutdown for Kill Topology #127

Closed
vikkyrk opened this issue Mar 7, 2016 · 0 comments
Closed

Gracefull Shutdown for Kill Topology #127

vikkyrk opened this issue Mar 7, 2016 · 0 comments
Assignees

Comments

@vikkyrk
Copy link

vikkyrk commented Mar 7, 2016

Use executor termination instead of using a separate Shutdown class

ExecutorService taskExecutor = Executors.newFixedThreadPool(4);
while(...) {
taskExecutor.execute(new MyTask());
}
taskExecutor.shutdown();
try {
taskExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
} catch (InterruptedException e) {
...
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants