title: How to stop execution after some time?
body: <p>I want to stop my Dash program from executing after a certain amount of time (even better when I close the browser window, though I doubt that's possible). Is there a way to interrupt it through python?</p>
  <p>I already tried putting a</p>
  <pre><code>sys.exit() 
  </code></pre>
  <p>after calling <code>app.run_server</code>. Though as far as I understand</p>
  <pre><code>app.run_server
  </code></pre>
  <p>is running code in an infinite loop, thus I'm never reaching <code>sys.exit()</code>.</p>
  <pre><code>if __name__ == '__main__':
      app.title = 'foo'
      app.run_server(debug=False)
      sys.exit(&quot;Bye!&quot;)
  </code></pre>