packages feed

yesod-websockets 0.2.2 → 0.2.3

raw patch · 3 files changed

+19/−2 lines, 3 files

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.2.3++* `receiveDataMessageE` and `sendDataMessageE`+ ## 0.2.2  * Add exceptional websocket commands [#772](https://github.com/yesodweb/yesod/pull/772)
Yesod/WebSockets.hs view
@@ -7,6 +7,7 @@     , webSockets     , receiveData     , receiveDataE+    , receiveDataMessageE     , sendPing     , sendPingE     , sendClose@@ -15,6 +16,7 @@     , sendTextDataE     , sendBinaryData     , sendBinaryDataE+    , sendDataMessageE       -- * Conduit API     , sourceWS     , sinkWSText@@ -32,7 +34,6 @@ import           Control.Monad.Trans.Control    (control) import           Control.Monad.Trans.Control    (MonadBaseControl (liftBaseWith, restoreM)) import           Control.Monad.Trans.Reader     (ReaderT (ReaderT, runReaderT))-import           Data.Either import qualified Data.Conduit                   as C import qualified Data.Conduit.List              as CL import qualified Network.Wai.Handler.WebSockets as WaiWS@@ -87,6 +88,12 @@ receiveDataE :: (MonadIO m, WS.WebSocketsData a) => WebSocketsT m (Either SomeException a) receiveDataE = ReaderT $ liftIO . tryAny . WS.receiveData +-- | Receive an application message.+-- Capture SomeException as the result or operation+-- Since 0.2.3+receiveDataMessageE :: (MonadIO m) => WebSocketsT m (Either SomeException WS.DataMessage)+receiveDataMessageE = ReaderT $ liftIO . tryAny . WS.receiveDataMessage+ -- | Send a textual message to the client. -- -- Since 0.1.0@@ -124,6 +131,12 @@ -- Since 0.2.2 sendPingE :: (MonadIO m, WS.WebSocketsData a) => a -> WebSocketsT m (Either SomeException ()) sendPingE = wrapWSE WS.sendPing++-- | Send a DataMessage to the client. +-- Capture SomeException as the result of operation+-- Since 0.2.3+sendDataMessageE :: (MonadIO m) => WS.DataMessage -> WebSocketsT m (Either SomeException ())+sendDataMessageE x = ReaderT $ liftIO . tryAny . (`WS.sendDataMessage` x)  -- | Send a close request to the client.  -- 
yesod-websockets.cabal view
@@ -1,5 +1,5 @@ name:                yesod-websockets-version:             0.2.2+version:             0.2.3 synopsis:            WebSockets support for Yesod description:         WebSockets support for Yesod homepage:            https://github.com/yesodweb/yesod