Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify that the dict view of a message is not part of the versioned protocol #522

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions docs/messaging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ are reasonably representable in JSON.
General Message Format
======================

A message is defined by the following four-dictionary structure::
A message can be represented as the following structure::

{
# The message header contains a pair of unique identifiers for the
Expand All @@ -105,7 +105,7 @@ A message is defined by the following four-dictionary structure::
'msg_type' : str,
# the message protocol version
'version' : '5.0',
},
},

# In a chain of messages, the header from the parent is copied so that
# clients can track where messages come from.
Expand All @@ -123,6 +123,15 @@ A message is defined by the following four-dictionary structure::
'buffers': list,
}

.. note::

This dictionary structure is *not* part of the Jupyter protocol
that must be implemented by kernels and frontends;
that would be :ref:`wire_protocol`,
which dictates how this information is serialized over the wire.
Deserialization is up to the Kernel or frontend implementation,
but a dict like this would be a logical choice in most contexts.

.. note::

The ``session`` id in a message header identifies a unique entity with state,
Expand Down Expand Up @@ -182,14 +191,17 @@ The Wire Protocol
=================


This message format exists at a high level,
The above message format is only a logical representation of the contents of Jupyter messages,
but does not describe the actual *implementation* at the wire level in zeromq.
The canonical implementation of the message spec is our :class:`~jupyter_client.session.Session` class.
This section describes the protocol that must be implemented by Jupyter kernels and clients
talking to each other over zeromq.

The reference implementation of the message spec is our :class:`~jupyter_client.session.Session` class.

.. note::

This section should only be relevant to non-Python consumers of the protocol.
Python consumers should simply import and the use implementation of the wire
Python consumers should import and the use implementation of the wire
protocol in :class:`jupyter_client.session.Session`.

Every message is serialized to a sequence of at least six blobs of bytes:
Expand Down