Here are the examples of the python api bokeh.server.protocol.Protocol taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
5 Examples
3
Example 1
Project: bokeh Source File: _connection.py
def __init__(self, session, websocket_url, io_loop=None):
'''
Opens a websocket connection to the server.
'''
self._url = websocket_url
self._session = session
self._protocol = Protocol("1.0")
self._receiver = Receiver(self._protocol)
self._socket = None
self._state = self.NOT_YET_CONNECTED()
if io_loop is None:
# We can't use IOLoop.current because then we break
# when running inside a notebook since ipython also uses it
io_loop = IOLoop()
self._loop = io_loop
self._until_predicate = None
self._protocol = Protocol("1.0")
self._server_info = None
0
Example 2
Project: bokeh Source File: test_patch_doc.py
def test_create_model_changed(self):
sample = self._sample_doc()
obj = next(iter(sample.roots))
event = docuement.ModelChangedEvent(sample, obj, 'foo', obj.foo, 42, 42)
Protocol("1.0").create("PATCH-DOC", [event])
0
Example 3
Project: bokeh Source File: test_pull_doc.py
def test_create_req(self):
Protocol("1.0").create("PULL-DOC-REQ")
0
Example 4
def test_create_reply(self):
sample = self._sample_doc()
Protocol("1.0").create("PULL-DOC-REPLY", 'fakereqid', sample)
0
Example 5
def test_create(self):
sample = self._sample_doc()
Protocol("1.0").create("PUSH-DOC", sample)