refactor(jupyter): move communication methods out of data structs (#23622)

Moves the communication methods out of the data structs and onto the
`Connection` struct.
This commit is contained in:
David Sherret 2024-04-30 22:30:40 -04:00 committed by GitHub
parent f2216c90a7
commit 486437fee1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 188 additions and 198 deletions

View file

@ -50,12 +50,16 @@ pub async fn op_jupyter_broadcast(
let maybe_last_request = last_execution_request.borrow().clone();
if let Some(last_request) = maybe_last_request {
last_request
.new_message(&message_type)
.with_content(content)
.with_metadata(metadata)
.with_buffers(buffers.into_iter().map(|b| b.to_vec().into()).collect())
.send(&mut *iopub_socket.lock().await)
(*iopub_socket.lock().await)
.send(
&last_request
.new_message(&message_type)
.with_content(content)
.with_metadata(metadata)
.with_buffers(
buffers.into_iter().map(|b| b.to_vec().into()).collect(),
),
)
.await?;
}