title: Streaming an in HTML embedded bokeh plot
body: <p>I am trying to embed a streaming bokeh plot into an HTML file using the autoload_server function:</p>
  
  <pre><code>from bokeh.client import push_session
  from bokeh.embed import autoload_server
  from bokeh.models import ColumnDataSource
  from bokeh.plotting import figure, curdoc
  
  data = dict(x=[], y=[])
  source = ColumnDataSource(data)
  
  plot = figure()
  plot.circle(source=source, x='x', y='y')
  
  counter = -1
  
  def update_data():
      global xDate, yWind, counter
      counter += 1
      xDate = counter
      yWind = counter
      new_data_wind = dict(x=[xDate], y=[yWind])
      source.stream(new_data_wind, 300)
  
  curdoc().add_root(plot)
  curdoc().add_periodic_callback(update_data, 300)
  
  session = push_session(curdoc())
  script = autoload_server(plot, session_id=session.id)
  print(script)
  </code></pre>
  
  <p>I basically start a bokeh server by using: "bokeh serve" and then run the code and insert the given script into an HTML file.</p>
  
  <p>At first, no plot would be displayed, but after adding --allow-websocket-origin=localhost:63342 to the bokeh serve command, the page would show the plot grid, but no data is displayed.</p>
  
  <p>Does someone have an idea as to why the data streaming function doesn't seem to work or what I can change to make the embedded plot stream the data?</p>
  
  <p>I'm thankful for any further input, since I have yet to find some on the Internet.</p>
  
  <p><strong>EDIT</strong>
  I've found the solution to my problem and will leave it here if anyone encounters something similar:</p>
  
  <p>The code fragment:</p>
  
  <pre><code>session.loop_until_closed()
  </code></pre>
  
  <p>needs to be added to the end of the example above, so the session is looped and the final plot gets updated inside the browser.</p>