{ } Raw JSON

bundles / jupyter_client 8.10.0 / jupyter_client / session / Session / send

function

jupyter_client.session:Session.send

source: /jupyter_client/session.py:760

Signature

def send(self, stream: zmq.sugar.socket.Socket | ZMQStream | None, msg_or_type: dict[str, t.Any] | str, content: dict[str, t.Any] | None = None, parent: dict[str, t.Any] | None = None, ident: bytes | list[bytes] | None = None, buffers: list[bytes | memoryview[bytes]] | None = None, track: bool = False, header: dict[str, t.Any] | None = None, metadata: dict[str, t.Any] | None = None) → dict[str, t.Any] | None

Summary

Build and send a message via stream or socket.

Extended Summary

The message format used by this function internally is as follows:

[ident1,ident2,...,DELIM,HMAC,p_header,p_parent,p_content,

buffer1,buffer2,...]

The serialize/deserialize methods convert the nested message dict into this format.

Parameters

stream : zmq.Socket or ZMQStream

The socket-like object used to send the data.

msg_or_type : str or Message/dict

Normally, msg_or_type will be a msg_type unless a message is being sent more than once. If a header is supplied, this can be set to None and the msg_type will be pulled from the header.

content : dict or None

The content of the message (ignored if msg_or_type is a message).

header : dict or None

The header dict for the message (ignored if msg_to_type is a message).

parent : Message or dict or None

The parent or parent header describing the parent of this message (ignored if msg_or_type is a message).

ident : bytes or list of bytes

The zmq.IDENTITY routing path.

metadata : dict or None

The metadata describing the message

buffers : list or None

The already-serialized buffers to be appended to the message.

track : bool

Whether to track. Only for use with Sockets, because ZMQStream objects cannot track messages.

Returns

msg : dict

The constructed message.

Aliases

  • jupyter_client.channels.Session.send

Referenced by