public void run() { try { while (!Thread.interrupted()) q.take().run(); // Run task with the current thread } catch (InterruptedException e) { // Acceptable way to exit } print("Finished DelayedTaskConsumer"); }
public void run() { try { while (!Thread.interrupted()) { Event event = q.take(); print(event); event.run(); } } catch (InterruptedException e) { // Acceptable way to exit } print("Finished Controller"); }