arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Listen

Description

Backend-agnostic LISTEN/NOTIFY hub over one connection per env.

Synopsis

Documentation

data NotificationSource #

A received notification. The channel it arrived on and its payload.

Constructors

Notification 

Fields

Instances

Instances details
Eq Notification Source # 
Instance details

Defined in Arbiter.Core.Listen

Show Notification Source # 
Instance details

Defined in Arbiter.Core.Listen

data ListenConnSource #

The connection operations the hub loop needs.

Constructors

ListenConn 

Fields

data ListenerSource #

Handle to an environment's shared, refcounted LISTEN hub slot.

data HubLogSource #

Hub event reporting preferences for a registrant.

Constructors

HubLog 

Fields

withChannels :: MonadUnliftIO m => Listener -> HubLog -> [(ByteString, Notification -> m ())] -> (STM Bool -> m a) -> m aSource #

Register the caller's channels on the env's shared hub for the duration of the body. The STM action reports True while they are all subscribed. A reconnect resets it.

newListener :: ((ListenConn -> IO ()) -> IO ()) -> IO ListenerSource #

A Listener with a fresh hub slot over a connection runner.