bokeh.application.handlers.server_lifecycle¶
Bokeh Application Handler to look for Bokeh server lifecycle callbacks in a specified Python module.
-
class
ServerLifecycleHandler
(*args, **kwargs)[source]¶ Load a script which contains server lifecycle callbacks.
-
modify_document
(doc)[source]¶ This handler does not make any modifications to the Document.
Parameters: doc (Document) – A Bokeh Document to update in-place
This handler does not modify the document
Returns: None
-
on_server_loaded
(server_context)[source]¶ Execute on_server_unloaded` from the configured module (if it is defined) when the server is first started.
Parameters: server_context (ServerContext) –
-
on_server_unloaded
(server_context)[source]¶ Execute
on_server_unloaded
from the configured module (if it is defined) when the server cleanly exits. (Before stopping the server’sIOLoop
.)Parameters: server_context (ServerContext) – Warning
In practice this code may not run, since servers are often killed by a signal.
-
on_session_created
(session_context)[source]¶ Execute
on_session_created
from the configured module (if it is defined) when a new session is created.Parameters: session_context (SessionContext) –
-
on_session_destroyed
(session_context)[source]¶ Execute
on_session_destroyed
from the configured module (if it is defined) when a new session is destroyed.Parameters: session_context (SessionContext) –
-
error
¶ If the handler fails, may contain a related error message.
-
error_detail
¶ If the handler fails, may contain a traceback or other details.
-
failed
¶ True
if the lifecycle callbacks failed to execute
-