No title

zincy 2018-04-16 12:31:28.297923 UTC

1talk :: WS.Connection -> MVar ServerState -> Client -> IO ()
2talk conn state (Client (name, _)) =
3 forever $ do
4 msg <- WS.receiveData conn
5 serverState <- readMVar state
6 print serverState
7 -- print $ "our unparsed ws message from" ++ T.unpack name
8 -- putStrLn $ T.unpack msg
9 print $ "our parsed ws message from: " ++ T.unpack name
10 print $ parseAuctionAction msg
11 readMVar state >>= broadcast msg
12 where
13 parsedAuctionAction = parseAuctionAction msg