-
Notifications
You must be signed in to change notification settings - Fork 17
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
jpype fails when using with flask #25
Comments
Thanks, good to know! Could you send a pull request with the change? |
I have the following observations while using PyStanfordDependencies in flask app, based on the argument passed in run() function of Flask app. Case 1: threaded=False
One needs to note that in flask\app.py (https://github.com/pallets/flask/blob/master/src/flask/app.py#L977),
This will set use_reloader=True if debug=True and use_reloader is not explicitly set off. https://stackoverflow.com/questions/28585033/why-does-a-flask-app-create-two-process Case 2: threaded=True For this, as mentioned in https://www.programcreek.com/python/example/107853/jpype.isThreadAttachedToJVM we would need:
But this will be required not only in Update: |
He, I wrapped your library in a flask app and had JPype fail due to an unsafe thread issue. I had to modify the JPypeBackend.py file to attach the thread to the JVM. Changes start on line 45:
JPypeBackend.py.zip
Attached the modified file here
The text was updated successfully, but these errors were encountered: