hasql-notifications 0.2.3.1 → 0.2.3.2
raw patch · 2 files changed
+11/−4 lines, 2 files
Files
- hasql-notifications.cabal +1/−1
- src/Hasql/Notifications.hs +10/−3
hasql-notifications.cabal view
@@ -1,5 +1,5 @@ name: hasql-notifications-version: 0.2.3.1+version: 0.2.3.2 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
@@ -17,8 +17,11 @@ FatalError (..), ) where--import Control.Concurrent (threadDelay, threadWaitRead)+#if defined(mingw32_HOST_OS)+import Control.Concurrent ( threadDelay )+#else+import Control.Concurrent (threadWaitRead, threadDelay)+#endif import Control.Exception (Exception, throw) import Control.Monad (forever, unless, void, when) import Data.ByteString.Char8 (ByteString)@@ -190,9 +193,13 @@ mfd <- PQ.socket pqCon case mfd of Nothing -> void $ threadDelay 1000000+#if defined(mingw32_HOST_OS)+ Just _ -> do+ void $ threadDelay 1000000+#else Just fd -> do void $ threadWaitRead fd-+#endif result <- PQ.consumeInput pqCon unless result $ do mError <- PQ.errorMessage pqCon