-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
TextInput stuck when running heavy calculations on server #138
Comments
Thanks for the report. I'll look into but as a quick aside:
This shouldn't be necessary, you can have the "app" work both in the notebook and on bokeh server by using Also when you want to test bokeh server from a notebook you could do |
Okay, so this is a pretty central part of how bokeh server works, changing a parameter value will schedule a so called |
Thank you very much for looking into all of the issues. For me personally either way is fine, if it is too hard to make it work the naive way, I can try with the |
@MHC03 So there's probably nothing we can do automatically, however you can do it by using the tornado IOLoop, in your example you'd do something like:
|
For me the above approach does not fully work, the second change to the textinput value does not occur. It is stuck with 'Start heavy calculation...'. If I change the code to following it works in a server but not in a Jupyter Notebook as intended: def _button_click(self, clicks):
self.txt.value = 'Start heavy calculation...'
ioloop = tornado.ioloop.IOLoop.current()
ioloop.add_callback(heavy_calculation)
self.txt.value = 'Heavy calculation finished.' With this I get the expected behaviour in a server, in a Jupyter Notebook it directly jumps to the last line without waiting for the callback to finish. If I have several heavy calculations it gets a bit more complicated through this method. |
This code would be a bit less confusing if you changed your show() method to view(), to avoid confusion with Panel's .show() method. |
Yeah, it's not quite clear to me what's going on here, it's definitely not working right in this case but I've used it successfully in other examples. |
Changed it, maybe @philippjfr can also edit his comment.
I will try some workaround with the ioloop callback for now. Thanks a lot for looking into this stuff. |
No problem, I'm encountering the same issues so this is fairly high priority. Still searching for a better solution, but my knowledge of tornado is lacking a bit. |
When I am trying to run heavy calculations and change the value of the TextInput beforehand, the value change somehow seems to be stuck. I have prepared a small example:
When I run this on a jupyter notebook, there is no problem:
But when I deploy it using
panel serve --show
, the first message on the TextInput widget does not appear:For deploying I have downloaded the notebook as a python file and edited
Test().view()
toTest().view().server_doc()
.epos is just a pandas DataFrame containing 36,000,000 elements.
I am not sure, whether this is a panel or bokeh problem.
The text was updated successfully, but these errors were encountered: