title: Gracefully exit using ThreadPoolExecutor
body: <p>When using a <code>ThreadPoolExecutor</code> how do you gracefully exit on a signal interrupt? I would like to intercept a SIGINT and gracefully exit the process. I would like the currently running threads to finish, but no more to start, and to cancel all pending tasks.</p>