mirror of
https://github.com/denoland/deno.git
synced 2025-09-23 10:52:33 +00:00
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:
parent
f2216c90a7
commit
486437fee1
4 changed files with 188 additions and 198 deletions
|
@ -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?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue