bokeh.application.handlers.server_lifecycle#
Bokeh Application Handler to look for Bokeh server lifecycle callbacks in a specified Python module.
- class ServerLifecycleHandler(*, filename: PathLike, argv: list[str] = [], package: ModuleType | None = None)[source]#
Load a script which contains server lifecycle callbacks.
Public Data Attributes:
If the handler fails, may contain a related error message.
If the handler fails, may contain a traceback or other details.
Trueif the lifecycle callbacks failed to executeInherited from
LifecycleHandlersafe_to_forkInherited from
HandlerIf the handler fails, may contain a related error message.
If the handler fails, may contain a traceback or other details.
Trueif the handler failed to modify the docsafe_to_forkPublic Methods:
__init__(*, filename[, argv, package])- keyword filename:
path to a module to load lifecycle callbacks from
url_path()The last path component for the basename of the path to the callback module.
Inherited from
LifecycleHandler__init__()modify_document(doc)This handler does not make any modifications to the Document.
on_server_loaded(server_context)Execute on_server_unloaded` from the configured module (if it is defined) when the server is first started.
on_server_unloaded(server_context)Execute
on_server_unloadedfrom the configured module (if it is defined) when the server cleanly exits.on_session_created(session_context)Execute
on_session_createdfrom the configured module (if it is defined) when a new session is created.on_session_destroyed(session_context)Execute
on_session_destroyedfrom the configured module (if it is defined) when a new session is destroyed.Inherited from
Handler__init__()modify_document(doc)Modify an application document in a specified manner.
on_server_loaded(server_context)Execute code when the server is first started.
on_server_unloaded(server_context)Execute code when the server cleanly exits.
on_session_created(session_context)Execute code when a new session is created.
on_session_destroyed(session_context)Execute code when a session is destroyed.
process_request(request)Processes incoming HTTP request returning a dictionary of additional data to add to the session_context.
Return a path to app-specific static resources, if applicable.
url_path()Returns a default URL path, if applicable.
- __init__(*, filename: PathLike, argv: list[str] = [], package: ModuleType | None = None) None[source]#