Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making it a wsgi middleware #9

Open
sque opened this issue Jul 26, 2017 · 2 comments
Open

Consider making it a wsgi middleware #9

sque opened this issue Jul 26, 2017 · 2 comments

Comments

@sque
Copy link
Collaborator

sque commented Jul 26, 2017

Current implementation is using Flask events to handle requests at the beggining and end of processing.

The alternative solution is to make it a Flask extension that adds itself as middleware wrapper around Flask application and process requests and responses outside flask context.

Advantages are:

  • No interaction with flask means less complexity
  • Logging of the requests as werkzeug does is not so effective inside Flask. after_request which holds the response object is not executed on exception and log event of errors may be lost
  • Probably the log of requests, does not need to be repeated and a simple filter and formatter on the logger of werkzeug is enought to fix the problem

Dissadvantages:

  • Need to rewrite current implementation
@sque sque added this to the Public-GA milestone Jul 26, 2017
@sque sque modified the milestone: Public-GA Sep 12, 2017
@kuldeeprishi
Copy link
Contributor

+1

@sque
Copy link
Collaborator Author

sque commented Jan 10, 2018

@kuldeeprishi Do you have any specific use case that should be considered for transition to middleware implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants