bokeh.server.contexts¶
Provides the Application, Server, and Session context classes.
- class ApplicationContext(application: Application, io_loop: IOLoop | None = None, url: str | None = None, logout_url: str | None = None)[source]¶
- Server-side holder for
bokeh.application.Applicationplus any associated data. This holds data that’s global to all sessions, while
ServerSessionholds data specific to an “instance” of the application.
Public Data Attributes:
io_loopapplicationurlserver_contextsessionsPublic Methods:
__init__(application[, io_loop, url, logout_url])run_load_hook()run_unload_hook()create_session_if_needed(session_id[, ...])get_session(session_id)- Server-side holder for
- class BokehServerContext(application_context: bokeh.server.contexts.ApplicationContext)[source]¶
- property sessions: List[bokeh.server.session.ServerSession]¶
SessionContextinstances belonging to this application.Subclasses must implement this method.
- class BokehSessionContext(session_id: ID, server_context: ServerContext, document: Document, logout_url: str | None = None)[source]¶
- async with_locked_document(func: Callable[[bokeh.document.document.Document], Awaitable[None]]) None[source]¶
Runs a function with the document lock held, passing the document to the function.
Subclasses must implement this method.
- Parameters
func (callable) – function that takes a single parameter (the Document) and returns
Noneor aFuture- Returns
a
Futurecontaining the result of the function