Merge pull request #1700 from Disco-Dave/yesod-websockets/remove-use-of-forkPingThread

Remove use of deprecated forkPingThread
This commit is contained in:
Michael Snoyman 2020-11-05 08:26:44 +02:00 committed by GitHub
commit 710d40d253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,6 @@
## 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)
## 0.3.0.2
* `sendClose` and `sendPing` correctly find the `Connection` from `WebSocketsT`

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Yesod.WebSockets
@ -117,8 +118,14 @@ webSocketsOptionsWith wsConnOpts buildAr inner = do
rhead
(\pconn -> do
conn <- WS.acceptRequestWith pconn ar
let app = runInIO $ runReaderT inner conn
#if MIN_VERSION_websockets(0,12,6)
WS.withPingThread conn 30 (pure ()) $ app
#else
WS.forkPingThread conn 30
runInIO $ runReaderT inner conn)
app
#endif
)
src
sink

View File

@ -1,5 +1,5 @@
name: yesod-websockets
version: 0.3.0.2
version: 0.3.0.3
synopsis: WebSockets support for Yesod
homepage: https://github.com/yesodweb/yesod
license: MIT