-
-
Notifications
You must be signed in to change notification settings - Fork 890
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
SocketIO.run() add additional reloader specific parameters. #1556
Conversation
Currently, the SocketIO development server can only include additional files, but not selectively exclude them during debugging. The Werkzeug reloader already provides a parameter to be able to exclude specific patterns, leveraging that ability, SocketIO would be able to do the same. An additional parameter was added the run() method has the same behavior across extra_files, exclude_patterns, and reloader_type The same has been done for the reloader_type additional argument. Werkzeug lets you choose which reloader to use and depending on the architecture/machine it may be beneficial to allow explicitly specifying the reloader used.
I think the idea is good, but I'm not sure there is a reasonable way to implement this. The I'm more inclined to say that if you want the full functionality of the reloader, then you should use the Flask dev server, and if you use a different server, then you get a minimal reloader. Supporting the reloader in a gevent/eventlet web server was just a measure that was necessary when the Flask dev server could not support WebSocket connections. This is now possible, so really during development there is no reason to use eventlet/gevent anymore. |
Thank you very much for the feedback! Currently all implementations (except the threading based one) construct a What I propose: I know that that might not be the best solution, but thought it might the "best of both worlds". What do you think? Thank you very much for your time and I would be willing to implement such a change - if desired. |
@indietyp Please have a look at the main branch and let me know if this works for you. I've added a |
@miguelgrinberg yes that works for me. Thanks for adding the feature! |
Currently, the SocketIO.run() method allows for some modifications of the reloader, specifically the ability to include extra_files, this pull request adds two new parameters to the SocketIO.run() method to further modify the behavior.
The exclude_patterns and reloader_type parameter, are just redirected to the reloader, but give SocketIO users the ability to further customize how the reloader functions.
This is helpful for projects that have huge e.g. asset folders in their project they would like to exclude, or where a specific reloader just does not work.