- lens :: ([String],Bool,[String],Bool) -> String
- lens (r,_,s,_) = "channels"
+ encode` m
+ | not (trace_tn (toString (toJSON m))) = undef
+ = encode m
+
+ messageShare :: Shared [String]
+ messageShare = sharedStore "mTaskMessagesRecv" []
+
+ processSDSs :: [(Int, Shared Int)] (Shared [String]) [MTaskMSGRecv] -> Task ()
+ processSDSs _ _ [] = return ()
+ processSDSs s y [x:xs] = updateSDSs s y x >>= \_->processSDSs s y xs
+
+ updateSDSs :: [(Int, Shared Int)] (Shared [String]) MTaskMSGRecv -> Task ()
+ updateSDSs _ m (MTMessage s) = upd (\l->[s:l]) m @! ()
+ updateSDSs _ _ MTEmpty = return ()
+ updateSDSs [(id, sh):xs] m n=:(MTPub i d)
+ | id == i = set ((toInt d.[0])*265 + toInt d.[1]) sh @! ()
+ = updateSDSs xs m n
+
+ lens :: ([MTaskMSGRecv],Bool,[MTaskMSGSend],Bool) -> ([String], [String])
+ lens (r,_,s,_) = (f r, map toString s)
+ where
+ f [] = []
+ f [MTEmpty:xs] = f xs
+ f [x:xs] = [toString x:f xs]
+
+ viewSh :: [(Int, Shared Int)] (Shared ([MTaskMSGRecv],Bool,[MTaskMSGSend],Bool)) -> Task ()
+ viewSh [] ch = return ()
+ viewSh [(i, sh):xs] ch
+ # sharename = "SDS-" +++ toString i
+ = (
+ viewSharedInformation ("SDS-" +++ toString i) [] sh ||-
+ forever (
+ enterInformation sharename []
+ >>* [OnAction ActionOk
+ (ifValue (\j->j>=1 && j <= 3)
+ (\c->set c sh
+ >>= \_->sendMsg (toSDSUpdate i c) ch
+ @! ()
+ )
+ )]
+ )
+ ) ||- viewSh xs ch
+
+ sdsShares = makeShares st
+
+ (msgs, st) = toMessages 500 (toRealByteCode (unMain bc))