git.iko.soy/typeable/postgresql-simple
on master help sign in
Change name of getNotificationIfAvailable to getNotificationNonBlocking
602c954Leon P Smith
src/Database/PostgreSQL/Simple/Notification.hs+3−3
@@ -19,7 +19,7 @@
19module Database.PostgreSQL.Simple.Notification
19module Database.PostgreSQL.Simple.Notification
20 ( Notification(..)
20 ( Notification(..)
21 , getNotification
21 , getNotification
22− , getNotificationIfAvailable
22+ , getNotificationNonBlocking
23 ) where
23 ) where
24
24
25import Control.Concurrent ( threadWaitRead )
25import Control.Concurrent ( threadWaitRead )
@@ -70,8 +70,8 @@ getNotification = loop False
70-- | Non-blocking variant of 'getNotification'. Returns a single notification,
70-- | Non-blocking variant of 'getNotification'. Returns a single notification,
71-- if available. If no notifications are available, returns 'Nothing'.
71-- if available. If no notifications are available, returns 'Nothing'.
72
72
73−getNotificationIfAvailable :: Connection -> IO (Maybe Notification)
73+getNotificationNonBlocking :: Connection -> IO (Maybe Notification)
74−getNotificationIfAvailable conn =
74+getNotificationNonBlocking conn =
75 withConnection conn $ \c -> do
75 withConnection conn $ \c -> do
76 mmsg <- PQ.notifies c
76 mmsg <- PQ.notifies c
77 case mmsg of
77 case mmsg of