title: Need to execute a function after returning the response in Flask
body: <p>For one request alone i need to execute a function after sending the response to the client. Because the function takes time and that ends up in connection timeout <code>Socket error: [Errno 32] Broken pipe</code></p>
  
  <p>Is there a way in  <strong>Flask</strong> to execute function after returning the request</p>