Commit 090ee844 authored by Libby Horacek's avatar Libby Horacek Committed by Sumit Sahrawat

Reply to CommInfoRequest with actual open comms

parent 50a144ce
......@@ -11,6 +11,7 @@ import Data.Aeson.Types (Pair)
import Data.Map (Map)
import Data.Monoid (mempty)
import Data.Text (Text, pack)
import qualified Data.Map as Map
import IHaskell.IPython.Types
instance ToJSON LanguageInfo where
......@@ -37,7 +38,7 @@ instance ToJSON Message where
, commInfo = commInfo
} =
object
[ "comm_info" .= commInfo ]
[ "comms" .= Map.map (\comm -> object ["target_name" .= comm]) commInfo ]
toJSON ExecuteRequest
{ getCode = code
......
......@@ -264,10 +264,11 @@ replyTo _ KernelInfoRequest{} replyHeader state =
})
replyTo _ CommInfoRequest{} replyHeader state =
let comms = Map.mapKeys (UUID.uuidToString) (openComms state) in
return
(state, CommInfoReply
{ header = replyHeader
, commInfo = mempty
, commInfo = Map.map (\(Widget w) -> targetName w) comms
})
-- Reply to a shutdown request by exiting the main thread. Before shutdown, reply to the request to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment