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.Application
plus any associated data. This holds data that’s global to all sessions, whileServerSession
holds data specific to an “instance” of the application.
- class BokehServerContext(application_context: ApplicationContext)[source]#
- property sessions: list[ServerSession]#
SessionContext
instances 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[[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
None
or aFuture
- Returns:
a
Future
containing the result of the function