This docs on this page refers to a PREVIOUS VERSION. For the latest stable release, go to https://docs.bokeh.org/

Archived docs for versions <= 1.0.4 have had to be modified from their original published configuration, and may be missing some features (e.g. source listing)

All users are encourage to update to version 1.1 or later, as soon as they are able.

bokeh.application.handlers.server_lifecycle — Bokeh 0.12.14 documentation

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