Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
6ce959d6
Commit
6ce959d6
authored
Nov 10, 2013
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respond gracefull to shutdown
parent
60df949a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
Writer.hs
IHaskell/Message/Writer.hs
+9
-4
Types.hs
IHaskell/Types.hs
+1
-0
No files found.
IHaskell/Message/Writer.hs
View file @
6ce959d6
...
...
@@ -14,10 +14,10 @@ import IHaskell.Types
-- ghc (api) version number like ints [7,6,2]. Could be done at compile
-- time, but for now there's no template haskell in IHaskell
ghcVersionInts
=
ints
$
map
read
$
words
$
map
(
\
x
->
case
x
of
'.'
->
' '
;
_
->
x
)
(
VERSION_ghc
::
String
)
ghcVersionInts
::
[
Int
]
ghcVersionInts
=
ints
.
map
read
.
words
.
map
dotToSpace
$
(
VERSION_ghc
::
String
)
where
dotToSpace
'.'
=
' '
dotToSpace
x
=
x
-- Convert message bodies into JSON.
instance
ToJSON
Message
where
...
...
@@ -71,6 +71,11 @@ instance ToJSON Message where
"docstring"
.=
objectDocString
o
]
toJSON
ShutdownReply
{
restartPending
=
restart
}
=
object
[
"restart"
.=
restart
]
toJSON
body
=
error
$
"Do not know how to convert to JSON for message "
++
show
body
...
...
IHaskell/Types.hs
View file @
6ce959d6
...
...
@@ -291,4 +291,5 @@ replyType KernelInfoRequestMessage = KernelInfoReplyMessage
replyType
ExecuteRequestMessage
=
ExecuteReplyMessage
replyType
CompleteRequestMessage
=
CompleteReplyMessage
replyType
ObjectInfoRequestMessage
=
ObjectInfoReplyMessage
replyType
ShutdownRequestMessage
=
ShutdownReplyMessage
replyType
messageType
=
error
$
"No reply for message type "
++
show
messageType
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment