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] | NoneSummary
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 ZMQStreamThe socket-like object used to send the data.
msg_or_type: str or Message/dictNormally, 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 NoneThe content of the message (ignored if msg_or_type is a message).
header: dict or NoneThe header dict for the message (ignored if msg_to_type is a message).
parent: Message or dict or NoneThe parent or parent header describing the parent of this message (ignored if msg_or_type is a message).
ident: bytes or list of bytesThe zmq.IDENTITY routing path.
metadata: dict or NoneThe metadata describing the message
buffers: list or NoneThe already-serialized buffers to be appended to the message.
track: boolWhether to track. Only for use with Sockets, because ZMQStream objects cannot track messages.
Returns
msg: dictThe constructed message.
Aliases
jupyter_client.channels.Session.send