send IOPub idle message with KernelInfoReply

This commit is contained in:
MMesch 2018-07-14 10:33:03 +02:00
parent 3fa882a45d
commit 1d9f7c357b
2 changed files with 13 additions and 2 deletions

View File

@ -163,7 +163,12 @@ replyTo :: MonadIO m
-> Message
-> MessageHeader
-> m Message
replyTo config _ _ KernelInfoRequest{} replyHeader =
replyTo config _ interface KernelInfoRequest{} replyHeader = do
let send = writeChan (iopubChannel interface)
idleHeader <- dupHeader replyHeader StatusMessage
liftIO . send $ PublishStatus idleHeader Idle
return
KernelInfoReply
{ header = replyHeader

View File

@ -255,7 +255,13 @@ replyTo :: ZeroMQInterface -> Message -> MessageHeader -> KernelState -> Interpr
-- Reply to kernel info requests with a kernel info reply. No computation needs to be done, as a
-- kernel info reply is a static object (all info is hard coded into the representation of that
-- message type).
replyTo _ KernelInfoRequest{} replyHeader state =
replyTo interface KernelInfoRequest{} replyHeader state = do
let send msg = liftIO $ writeChan (iopubChannel interface) msg
-- Notify the frontend that the Kernel is idle
idleHeader <- liftIO $ dupHeader replyHeader StatusMessage
send $ PublishStatus idleHeader Idle
return
(state, KernelInfoReply
{ header = replyHeader