| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.Listen
Contents
Description
Backend-agnostic LISTEN/NOTIFY hub over one libpq connection per env.
Synopsis
- data Notification = Notification {}
- data Listener
- data RunningHub
- data HubLog = HubLog {
- hubRecovered :: Text -> IO ()
- hubWarn :: Text -> IO ()
- hubError :: Text -> IO ()
- hubRepeatInterval :: NominalDiffTime
- withChannels :: MonadUnliftIO m => Listener -> HubLog -> [(ByteString, Notification -> m ())] -> (STM Bool -> m a) -> m a
- newPoolListener :: ((Connection -> IO ()) -> IO ()) -> IO Listener
- data DedicatedListen
- newDedicatedListen :: MonadIO m => ByteString -> m DedicatedListen
- dedicatedListener :: DedicatedListen -> Listener
Documentation
Source #data Notification
A received notification. The channel it arrived on and its payload.
Constructors
| Notification | |
Fields | |
Instances
| Eq Notification Source # | |
Defined in Arbiter.Core.Listen | |
| Show Notification Source # | |
Defined in Arbiter.Core.Listen Methods #showsPrec :: Int -> Notification -> ShowS #show :: Notification -> String #showList :: [Notification] -> ShowS | |
Source #data RunningHub
Mutable hub state behind the slot. Opaque to callers.
How a registrant wants hub events reported.
Constructors
| HubLog | |
Fields
| |
Source #withChannels :: MonadUnliftIO m => Listener -> HubLog -> [(ByteString, Notification -> m ())] -> (STM Bool -> m a) -> m a
Source #newPoolListener :: ((Connection -> IO ()) -> IO ()) -> IO Listener
Build a pool-backed Listener with a fresh hub slot from a connection runner.
Dedicated-connection listener
Source #data DedicatedListen
A listener over its own libpq connection opened from a connection string.
Source #newDedicatedListen :: MonadIO m => ByteString -> m DedicatedListen
Allocate a DedicatedListen from a connection string, once at startup.
Source #dedicatedListener :: DedicatedListen -> Listener
The Listener for a DedicatedListen.