Verified Commit 69c2dcb7 authored by Camil Staps's avatar Camil Staps 🚀

Use in-memory shares for TCP connections and in/output

parent 087d27cf
......@@ -75,11 +75,11 @@ JSONDecode{|Connection|} _ json = case json of
derive class iTask ElectronProcess, TCPLocal, TCPMsg, TCPShare
tcpShare :: SimpleSDSLens TCPShare
tcpShare = sharedStore "tcpShare"
tcpShare =: sdsFocus "tcpShare" (memoryStore "Electron" (Just
{ rendererCounter = 0
, tcpRx = 'Data.Map'.newMap
, tcpTx = 'Data.Map'.newMap
}
}))
tcpConnection :: !ElectronProcess -> SimpleSDSLens (Maybe Connection)
tcpConnection processId = mapReadWrite
......@@ -89,7 +89,10 @@ tcpConnection processId = mapReadWrite
Just conn -> 'Data.Map'.put processId conn map
)
Nothing
(sharedStore "tcpConnections" 'Data.Map'.newMap)
tcpConnections
tcpConnections :: SimpleSDSLens (Map ElectronProcess Connection)
tcpConnections =: sdsFocus "tcpConnections" (memoryStore "Electron" (Just 'Data.Map'.newMap))
serveElectron ::
!([String] EngineOptions -> EngineOptions)
......
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