Implements a very low level facility for communicating with a Bokeh Server.
Users will always want to use ClientSession instead for standard usage.
ClientSession
ClientConnection
A Bokeh low-level class used to implement ClientSession; use ClientSession to connect to the server.
__init__
Opens a websocket connection to the server.
close
Close the Websocket connection.
force_roundtrip
Force a round-trip request/reply to the server, sometimes needed to avoid race conditions. Mostly useful for testing.
Outside of test suites, this method hurts performance and should not be needed.
None
loop_until_closed
Execute a blocking loop that runs and executes event callbacks until the connection is closed (e.g. by hitting Ctrl-C).
While this method can be used to run Bokeh application code “outside” the Bokeh server, this practice is HIGHLY DISCOURAGED for any real use case.
pull_doc
Pull a document from the server, overwriting the passed-in document
document – (Document) The document to overwrite with server content.
push_doc
Push a document to the server, overwriting any existing server-side doc.
document – (Document) A Document to push to the server
The server reply
request_server_info
Ask for information about the server.
A dictionary of server attributes.
connected
Whether we’ve connected the Websocket and have exchanged initial handshake messages.
io_loop
The Tornado IOLoop this connection is using.
IOLoop
url
The URL of the websocket this Connection is to.