Use forkPingThread if websockets is less than 0.12.6.0
This commit is contained in:
parent
da09fdc69a
commit
c00d1e1aa8
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
module Yesod.WebSockets
|
module Yesod.WebSockets
|
||||||
@ -117,8 +118,14 @@ webSocketsOptionsWith wsConnOpts buildAr inner = do
|
|||||||
rhead
|
rhead
|
||||||
(\pconn -> do
|
(\pconn -> do
|
||||||
conn <- WS.acceptRequestWith pconn ar
|
conn <- WS.acceptRequestWith pconn ar
|
||||||
WS.withPingThread conn 30 (pure ()) $
|
let app = runInIO $ runReaderT inner conn
|
||||||
runInIO $ runReaderT inner conn)
|
#if MIN_VERSION_websockets(0,12,6)
|
||||||
|
WS.withPingThread conn 30 (pure ()) $ app
|
||||||
|
#else
|
||||||
|
WS.forkPingThread conn 30
|
||||||
|
app
|
||||||
|
#endif
|
||||||
|
)
|
||||||
src
|
src
|
||||||
sink
|
sink
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user