hasql-notifications 0.2.0.5 → 0.2.0.6
raw patch · 2 files changed
+11/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hasql-notifications.cabal +1/−1
- src/Hasql/Notifications.hs +10/−0
hasql-notifications.cabal view
@@ -1,5 +1,5 @@ name: hasql-notifications-version: 0.2.0.5+version: 0.2.0.6 synopsis: LISTEN/NOTIFY support for Hasql description: Use PostgreSQL Asynchronous notification support with your Hasql Types. homepage: https://github.com/diogob/hasql-notifications
src/Hasql/Notifications.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-| This module has functions to send commands LISTEN and NOTIFY to the database server. It also has a function to wait for and handle notifications on a database connection.@@ -30,7 +31,11 @@ import Data.ByteString.Char8 (ByteString) import Data.Functor.Contravariant (contramap) import Control.Monad (void, forever)+#if defined(mingw32_HOST_OS)+import Control.Concurrent ( threadDelay )+#else import Control.Concurrent (threadWaitRead)+#endif import Control.Exception (Exception, throw) -- | A wrapped text that represents a properly escaped and quoted PostgreSQL identifier@@ -160,8 +165,13 @@ mfd <- PQ.socket pqCon case mfd of Nothing -> panic "Error checking for PostgreSQL notifications"+#if defined(mingw32_HOST_OS)+ Just _ -> do+ void $ threadDelay 1000000+#else Just fd -> do void $ threadWaitRead fd+#endif void $ PQ.consumeInput pqCon Just notification -> sendNotification (PQ.notifyRelname notification) (PQ.notifyExtra notification)