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.

__init__(*args, **kwargs)[source]
Keyword Arguments:
 
  • filename (str) – path to a module to load lifecycle callbacks from
  • argv (list[str], optional) – a list of string arguments to use as sys.argv when the callback code is executed. (default: [])
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’s IOLoop.)

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) –
url_path()[source]

The last path component for the basename of the path to the callback module.

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