title: Python - ThreadPoolExecutor blocking. How to unblock
body: <p>The following code is blocking:</p>
  
  <pre><code>import threading
  from concurrent.futures import ThreadPoolExecutor
  import os
  from pprint import pprint
  import time
  
  
  def sleep(seconds):
      for i in range(seconds):
          try:
              time.sleep(1)
          except KeyboardInterrupt:
              continue
  
  
  def get_instance():
      return threading.current_thread()
  
  
  def handle_instance(h):
      pprint("Got instance " + str(h.result()))
      sleep(6)
  
  
  def task():
      print("Executing our Task on Process: {}".format(os.getpid()))
  
  
  def main():
      with ThreadPoolExecutor(1) as th_exec:
          th_future = th_exec.submit(get_instance)
          th_future.add_done_callback(handle_instance)
  
  
  if __name__ == "__main__":
      while True:
          main()
          sleep(1)
  </code></pre>
  
  <p>I expect that after 6 seconds, a handful of threads would have output at once. This did not happen. Not sure how I managed this or what I'm forgetting here.</p>