| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.Listen
Description
Backend-agnostic LISTEN/NOTIFY hub over one connection per env.
Synopsis
- data Notification = Notification {}
- data ListenConn = ListenConn {
- listenNotifies :: IO (Maybe Notification)
- listenSocket :: IO (Maybe Fd)
- listenConsumeInput :: IO Bool
- listenExec :: ByteString -> IO (Either Text ())
- listenEscapeIdentifier :: ByteString -> IO (Maybe ByteString)
- data Listener
- 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
- newListener :: ((ListenConn -> IO ()) -> IO ()) -> IO Listener
Documentation
data NotificationSource #
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# | |
data ListenConnSource #
The connection operations the hub loop needs.
Constructors
| ListenConn | |
Fields
| |
Hub event reporting preferences for a registrant.
Constructors
| HubLog | |
Fields
| |
withChannels :: MonadUnliftIO m => Listener -> HubLog -> [(ByteString, Notification -> m ())] -> (STM Bool -> m a) -> m aSource #
newListener :: ((ListenConn -> IO ()) -> IO ()) -> IO ListenerSource #
A Listener with a fresh hub slot over a connection runner.