Verified Commit f0c3402d authored by Camil Staps's avatar Camil Staps 🚀

Add tcpQueueEmpty

parent 69c2dcb7
......@@ -4,6 +4,7 @@ from StdMaybe import :: Maybe
from ABC.Interpreter.JavaScript import :: JSVal, :: JSFun, :: JSWorld
from Text.GenJSON import :: JSONNode, generic JSONEncode, generic JSONDecode
from iTasks.Engine import :: EngineOptions
from iTasks.SDS.Definition import :: SimpleSDSLens, :: SDSLens
from iTasks.WF.Definition import :: Task
:: ElectronProcess
......@@ -36,6 +37,8 @@ from iTasks.WF.Definition import :: Task
derive JSONEncode TransportMethod
derive JSONDecode TransportMethod
tcpQueueEmpty :: SimpleSDSLens Bool
serveElectron ::
!([String] EngineOptions -> EngineOptions)
!(ElectronProcess UniversalConnectionDetails -> Task Connection)
......
......@@ -81,6 +81,14 @@ tcpShare =: sdsFocus "tcpShare" (memoryStore "Electron" (Just
, tcpTx = 'Data.Map'.newMap
}))
tcpQueueEmpty :: SimpleSDSLens Bool
tcpQueueEmpty =: mapReadWrite
( \{tcpTx} -> all isEmpty ('Data.Map'.elems tcpTx)
, \_ _ -> Nothing
)
Nothing
tcpShare
tcpConnection :: !ElectronProcess -> SimpleSDSLens (Maybe Connection)
tcpConnection processId = mapReadWrite
( 'Data.Map'.get processId
......
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