Skip to content

Commit

Permalink
Send replies on the appropriate socket (Jupyter messaging protocol v5.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
halleysfifthinc committed Dec 18, 2024
1 parent e914836 commit 2ffe9e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/comm_manager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function comm_info_request(sock, msg)
end
content = Dict(:comms => _comms)

send_ipython(IJulia.publish[],
send_ipython(sock,
msg_reply(msg, "comm_info_reply", content))
end

Expand Down
8 changes: 4 additions & 4 deletions src/handlers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ function complete_request(socket, msg)
end

function kernel_info_request(socket, msg)
send_ipython(requests[],
send_ipython(socket,
msg_reply(msg, "kernel_info_reply",
Dict("protocol_version" => "5.0",
Dict("protocol_version" => "5.4",
"implementation" => "ijulia",
"implementation_version" => pkgversion(@__MODULE__),
"language_info" =>
Expand Down Expand Up @@ -189,7 +189,7 @@ function connect_request(socket, msg)
end

function shutdown_request(socket, msg)
send_ipython(requests[], msg_reply(msg, "shutdown_reply",
send_ipython(socket, msg_reply(msg, "shutdown_reply",
msg.content))
sleep(0.1) # short delay (like in ipykernel), to hopefully ensure shutdown_reply is sent
exit()
Expand Down Expand Up @@ -271,7 +271,7 @@ end

function interrupt_request(socket, msg)
@async Base.throwto(requests_task[], InterruptException())
send_ipython(requests[], msg_reply(msg, "interrupt_reply", Dict()))
send_ipython(socket, msg_reply(msg, "interrupt_reply", Dict()))
end

function unknown_request(socket, msg)
Expand Down
2 changes: 1 addition & 1 deletion src/msg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ msg_header(m::Msg, msg_type::String) = Dict("msg_id" => uuid4(),
"session" => m.header["session"],
"date" => now(),
"msg_type" => msg_type,
"version" => "5.3")
"version" => "5.4")

# PUB/broadcast messages use the msg_type as the ident, except for
# stream messages which use the stream name (e.g. "stdout").
Expand Down

0 comments on commit 2ffe9e0

Please sign in to comment.