bokeh.server.protocol.Protocol

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 7

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

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])

Example 3

Project: bokeh Source File: test_pull_doc.py
    def test_create_req(self):
        Protocol("1.0").create("PULL-DOC-REQ")

Example 4

Project: bokeh Source File: test_pull_doc.py
Function: test_create_reply
    def test_create_reply(self):
        sample = self._sample_doc()
        Protocol("1.0").create("PULL-DOC-REPLY", 'fakereqid', sample)

Example 5

Project: bokeh Source File: test_push_doc.py
Function: test_create
    def test_create(self):
        sample = self._sample_doc()
        Protocol("1.0").create("PUSH-DOC", sample)