Commit 91c73c45 authored by Grégoire Locqueville's avatar Grégoire Locqueville

Removed dead module Nanomsg

parent b89fdced
Pipeline #7135 canceled with stages
in 9 seconds
......@@ -201,7 +201,6 @@ library
Gargantext.Core.Notifications.Dispatcher.Subscriptions
Gargantext.Core.Notifications.Dispatcher.Types
Gargantext.Core.Notifications.Dispatcher.WebSocket
Gargantext.Core.Notifications.Nanomsg
Gargantext.Core.Text
Gargantext.Core.Text.Context
Gargantext.Core.Text.Corpus.API
......
......@@ -91,35 +91,6 @@ instance ToJSON Topic where
]
toJSON Ping = Aeson.object [ "type" .= ("ping" :: Text) ]
-- | A job status message
-- newtype MJobStatus = MJobStatus (JobStatus 'Safe JobLog)
-- instance Prelude.Show MJobStatus where
-- show (MJobStatus js) = "MJobStatus " <> show (CBUTF8.decode $ BSL.unpack $ Aeson.encode js)
-- instance ToJSON MJobStatus where
-- toJSON (MJobStatus js) = Aeson.object [
-- "type" .= toJSON ("MJobLog" :: Text)
-- , "job_status" .= toJSON js
-- ]
-- instance FromJSON MJobStatus where
-- parseJSON = Aeson.withObject "MJobStatus" $ \o -> do
-- js <- o .: "job_status"
-- pure $ MJobStatus js
-- | A job progress message
-- newtype MJobLog = MJobLog JobLog
-- instance Prelude.Show MJobLog where
-- show (MJobLog jl) = "MJobLog " <> show jl
-- instance ToJSON MJobLog where
-- toJSON (MJobLog jl) = Aeson.object [
-- "type" .= toJSON ("MJobLog" :: Text)
-- , "job_log" .= toJSON jl
-- ]
-- instance FromJSON MJobLog where
-- parseJSON = Aeson.withObject "MJobLog" $ \o -> do
-- jl <- o .: "job_log"
-- pure $ MJobLog jl
data ConnectedUser =
CUUser UserId
......@@ -136,8 +107,6 @@ instance Eq WSKeyConnection where
(==) (WSKeyConnection (key1, _conn1)) (WSKeyConnection (key2, _conn2)) = key1 == key2
instance Show WSKeyConnection where
showsPrec d (WSKeyConnection (key, _conn)) = showsPrec d $ "WSKeyConnection " <> key
showWSKeyConnection :: WSKeyConnection -> Text
showWSKeyConnection ws = "WSKeyConnection " <> show (wsKey ws)
wsKey :: WSKeyConnection -> ByteString
wsKey (WSKeyConnection (key, _conn)) = key
wsConn :: WSKeyConnection -> WS.Connection
......
{-|
Module : Gargantext.Core.Notifications.Nanomsg
Description : Nanomsg utils
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
https://gitlab.iscpif.fr/gargantext/haskell-gargantext/issues/341
Docs:
https://dev.sub.gargantext.org/#/share/Notes/187918
-}
module Gargantext.Core.Notifications.Nanomsg where
import Gargantext.Prelude
import Nanomsg
withSafeSocket :: SocketType a => Text -> a -> (Socket a -> IO c) -> IO c
withSafeSocket socketName t =
bracket onOpen onClose
where
onOpen = do
s <- socket t
setRcvBuf s 1
setSndBuf s 1
rcvBufInt <- rcvBuf s
sndBufInt <- sndBuf s
putText $ "[" <> socketName <> "] rcvBuf: " <> show rcvBufInt <> ", sndBuf: " <> show sndBufInt
pure s
onClose s = do
close s
panicTrace $ "[withSafeSocket] " <> socketName <> " closed"
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