Non responding example when using push_session

Hi!

When trying to view the example sliders.py from GH I rand into the following issue.

Starting a bokeh server with the following command prompt:

bokeh serve --show

and in the file appending these two lines at the end of the document (as well as adding the import to the top of the file):

session = push_session(curdoc())

session.show()

Resulted in showing a plot with sliders and a text-box, but change in the widgets elicited no change in the plot. Did I screw something up?

Robert

Hi Robert,

There are a few ways to interact with the Bokeh server, either by running apps directly in the server, or by connecting another python process with the client API. The sliders.py was written with the former in mind, and so was intended to be run like:

   bokeh serve --show sliders.py

with no modifications. But if you are interested in using the client API, then yes you'd add the two lines you have, but you also need to add something like:

  session.loop_until_closed()

at the very end. What's happening now is you run sliders.py, it publishes the plot, and then the script ends and the python process (the one you want to handle the callbacks!) terminates. The line above keeps the script running and continuing to respond to model changes.

Thanks,

Bryan

ยทยทยท

On Jan 29, 2016, at 8:08 AM, Robert <[email protected]> wrote:

Hi!

When trying to view the example sliders.py from GH I rand into the following issue.

Starting a bokeh server with the following command prompt:

               bokeh serve --show

and in the file appending these two lines at the end of the document (as well as adding the import to the top of the file):

               session = push_session(curdoc())
               session.show()

Resulted in showing a plot with sliders and a text-box, but change in the widgets elicited no change in the plot. Did I screw something up?

Robert
               
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5a856fe6-0c2b-4405-81a3-5e0cb918776e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.