Provides the Application, Server, and Session context classes.
ApplicationContext
Server-side holder for bokeh.application.Application plus any associated data. This holds data that’s global to all sessions, while ServerSession holds data specific to an “instance” of the application.
bokeh.application.Application
ServerSession
BokehServerContext
add_next_tick_callback
Add a callback to be run on the next tick of the event loop.
Subclasses must implement this method.
callback (callable) –
a callback to add
The callback will execute on the next tick of the event loop, and should have the form def callback() (i.e. it should not accept any arguments)
def callback()
an ID that can be used with remove_next_tick_callback.
remove_next_tick_callback
add_periodic_callback
Add a callback to be run periodically until it is removed.
The callback will execute periodically on the event loop as specified, and should have the form def callback() (i.e. it should not accept any arguments)
period_milliseconds (int) – number of milliseconds to wait between executing the callback.
an ID that can be used with remove_periodic_callback.
remove_periodic_callback
add_timeout_callback
Add a callback to be run once after timeout_milliseconds.
The callback will execute once on the event loop after the timeout has passed, and should have the form def callback() (i.e. it should not accept any arguments)
timeout_milliseconds (int) – number of milliseconds to wait before executing the callback.
an ID that can be used with remove_timeout_callback.
remove_timeout_callback
Remove a callback added with add_next_tick_callback, before it runs.
callback_id – the ID returned from add_next_tick_callback
Removes a callback added with add_periodic_callback.
callback_id – the ID returned from add_periodic_callback
Remove a callback added with add_timeout_callback, before it runs.
callback_id – the ID returned from add_timeout_callback
sessions
SessionContext instances belonging to this application.
SessionContext
BokehSessionContext
with_locked_document
Runs a function with the document lock held, passing the document to the function.
func (callable) – function that takes a single parameter (the Document) and returns None or a Future
None
Future
a Future containing the result of the function
destroyed
If True, the session has been discarded and cannot be used.
True
A new session with the same ID could be created later but this instance will not come back to life.