wai-websockets 3.0.0 → 3.0.0.1
raw patch · 2 files changed
+3/−3 lines, 2 files
Files
- server.lhs +2/−2
- wai-websockets.cabal +1/−1
server.lhs view
@@ -13,7 +13,7 @@ > import Data.Text (Text) > import Control.Exception (fromException, handle) > import Control.Monad (forM_, forever)-> import Control.Concurrent (MVar, newMVar, modifyMVar_, readMVar)+> import Control.Concurrent (MVar, newMVar, modifyMVar_, readMVar, forkIO) > import Control.Monad.IO.Class (liftIO) > import qualified Data.Text as T > import qualified Data.Text.IO as T@@ -66,7 +66,7 @@ > broadcast :: Text -> ServerState -> IO () > broadcast message clients = do > T.putStrLn message-> forM_ clients $ \(_, conn) -> WS.sendTextData conn message+> forM_ clients $ \(_, conn) -> forkIO $ WS.sendTextData conn message The main function first creates a new state for the server, then spawns the actual server. For this purpose, we use the simple server provided by
wai-websockets.cabal view
@@ -1,5 +1,5 @@ Name: wai-websockets-Version: 3.0.0+Version: 3.0.0.1 Synopsis: Provide a bridge betweeen WAI and the websockets package. License: MIT License-file: LICENSE