arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Listen

Description

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

Synopsis

Documentation

Source #data Notification

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

Instances

Instances details
Eq Notification Source # 
Instance details

Defined in Arbiter.Core.Listen

Show Notification Source # 
Instance details

Defined in Arbiter.Core.Listen

Source #data Listener

Everything the worker needs to run a shared listener for one env.

Source #data RunningHub

Mutable hub state behind the slot. Opaque to callers.

Source #data HubLog

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

Register this pool's channels on the env's shared hub for the duration of k. The STM action reports True once they are all subscribed.

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.