Fix compliance with Jupyter 5.0 spec for idle messages

This commit is contained in:
Tom McLaughlin 2019-05-20 19:46:50 -07:00
parent d587ce1381
commit cea94e8eb0

View File

@ -191,6 +191,10 @@ runKernel kOpts profileSrc = do
-- Write the reply to the reply channel.
liftIO $ writeChan (shellReplyChannel interface) reply
-- Notify the frontend that we're done computing.
idleHeader <- liftIO $ dupHeader replyHeader StatusMessage
liftIO $ writeChan (iopubChannel interface) $ PublishStatus idleHeader Idle
where
ignoreCtrlC =
installHandler keyboardSignal (CatchOnce $ putStrLn "Press Ctrl-C again to quit kernel.")
@ -290,10 +294,6 @@ replyTo interface req@ExecuteRequest { getCode = code } replyHeader state = do
publish = publishResult send replyHeader displayed updateNeeded pOut (usePager state)
updatedState <- evaluate state (T.unpack code) publish widgetMessageHandler
-- Notify the frontend that we're done computing.
idleHeader <- liftIO $ dupHeader replyHeader StatusMessage
send $ PublishStatus idleHeader Idle
-- Take pager output if we're using the pager.
pager <- if usePager state
then liftIO $ readMVar pOut
@ -440,8 +440,4 @@ handleComm send kernelState req replyHeader = do
-- Only sensible thing to do.
return kernelState
-- Notify the frontend that the kernel is idle once again
idleHeader <- liftIO $ dupHeader replyHeader StatusMessage
liftIO . send $ PublishStatus idleHeader Idle
return newState