Merge pull request #1790 from ricky0123/fix-websocket-chat
Fix websocket examples
This commit is contained in:
commit
66bed05d33
@ -1,3 +1,7 @@
|
|||||||
|
## 0.3.0.4
|
||||||
|
|
||||||
|
* Fixed examples to work with Template Haskell change in recent GHC versions ([#1790](https://github.com/yesodweb/yesod/pull/1790)).
|
||||||
|
|
||||||
## 0.3.0.3
|
## 0.3.0.3
|
||||||
* Removed the use of the deprecated forkPingThread and replaced it with the recommended withPingThread. [#1700](https://github.com/yesodweb/yesod/pull/1700)
|
* Removed the use of the deprecated forkPingThread and replaced it with the recommended withPingThread. [#1700](https://github.com/yesodweb/yesod/pull/1700)
|
||||||
|
|
||||||
|
|||||||
@ -15,12 +15,12 @@ import UnliftIO.Exception (try, SomeException)
|
|||||||
|
|
||||||
data App = App (TVar (M.Map Text (TChan Text, Int)))
|
data App = App (TVar (M.Map Text (TChan Text, Int)))
|
||||||
|
|
||||||
instance Yesod App
|
|
||||||
|
|
||||||
mkYesod "App" [parseRoutes|
|
mkYesod "App" [parseRoutes|
|
||||||
/ HomeR GET
|
/ HomeR GET
|
||||||
|]
|
|]
|
||||||
|
|
||||||
|
instance Yesod App
|
||||||
|
|
||||||
cleanupChannel :: (Eq a1, Num a1) => Maybe (a2, a1) -> Maybe (a2, a1)
|
cleanupChannel :: (Eq a1, Num a1) => Maybe (a2, a1) -> Maybe (a2, a1)
|
||||||
cleanupChannel Nothing = Nothing
|
cleanupChannel Nothing = Nothing
|
||||||
cleanupChannel (Just (writeChan, 1)) = Nothing
|
cleanupChannel (Just (writeChan, 1)) = Nothing
|
||||||
|
|||||||
@ -14,12 +14,12 @@ import UnliftIO.Exception (try, SomeException)
|
|||||||
|
|
||||||
data App = App (TChan Text)
|
data App = App (TChan Text)
|
||||||
|
|
||||||
instance Yesod App
|
|
||||||
|
|
||||||
mkYesod "App" [parseRoutes|
|
mkYesod "App" [parseRoutes|
|
||||||
/ HomeR GET
|
/ HomeR GET
|
||||||
|]
|
|]
|
||||||
|
|
||||||
|
instance Yesod App
|
||||||
|
|
||||||
chatApp :: WebSocketsT Handler ()
|
chatApp :: WebSocketsT Handler ()
|
||||||
chatApp = do
|
chatApp = do
|
||||||
sendTextData ("Welcome to the chat server, please enter your name." :: Text)
|
sendTextData ("Welcome to the chat server, please enter your name." :: Text)
|
||||||
|
|||||||
@ -14,12 +14,12 @@ import UnliftIO.Exception (try, SomeException)
|
|||||||
|
|
||||||
data App = App (TChan Text)
|
data App = App (TChan Text)
|
||||||
|
|
||||||
instance Yesod App
|
|
||||||
|
|
||||||
mkYesod "App" [parseRoutes|
|
mkYesod "App" [parseRoutes|
|
||||||
/ HomeR GET
|
/ HomeR GET
|
||||||
|]
|
|]
|
||||||
|
|
||||||
|
instance Yesod App
|
||||||
|
|
||||||
chatApp :: WebSocketsT Handler ()
|
chatApp :: WebSocketsT Handler ()
|
||||||
chatApp = do
|
chatApp = do
|
||||||
sendTextData ("Welcome to the chat server, please enter your name." :: Text)
|
sendTextData ("Welcome to the chat server, please enter your name." :: Text)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
name: yesod-websockets
|
name: yesod-websockets
|
||||||
version: 0.3.0.3
|
version: 0.3.0.4
|
||||||
synopsis: WebSockets support for Yesod
|
synopsis: WebSockets support for Yesod
|
||||||
homepage: https://github.com/yesodweb/yesod
|
homepage: https://github.com/yesodweb/yesod
|
||||||
license: MIT
|
license: MIT
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user