| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Hasql.ListenNotify
Description
LISTEN/NOTIFY with hasql.
Synopsis
- newtype Identifier = Identifier ByteString
- listen :: Identifier -> Statement () ()
- unlisten :: Identifier -> Statement () ()
- unlistenAll :: Statement () ()
- escapeIdentifier :: Text -> Session Identifier
- data Notification = Notification {}
- await :: Session Notification
- poll :: Session (Maybe Notification)
- backendPid :: Session CPid
- data Notify = Notify {}
- notify :: Statement Notify ()
Listen
newtype Identifier Source #
A Postgres identifier.
Constructors
| Identifier ByteString |
Instances
| Show Identifier Source # | |
Defined in Hasql.ListenNotify Methods showsPrec :: Int -> Identifier -> ShowS # show :: Identifier -> String # showList :: [Identifier] -> ShowS # | |
| Eq Identifier Source # | |
Defined in Hasql.ListenNotify | |
| Ord Identifier Source # | |
Defined in Hasql.ListenNotify Methods compare :: Identifier -> Identifier -> Ordering # (<) :: Identifier -> Identifier -> Bool # (<=) :: Identifier -> Identifier -> Bool # (>) :: Identifier -> Identifier -> Bool # (>=) :: Identifier -> Identifier -> Bool # max :: Identifier -> Identifier -> Identifier # min :: Identifier -> Identifier -> Identifier # | |
listen :: Identifier -> Statement () () Source #
Listen to a channel.
unlisten :: Identifier -> Statement () () Source #
Stop listening to a channel.
unlistenAll :: Statement () () Source #
Stop listening to all channels.
escapeIdentifier :: Text -> Session Identifier Source #
Escape a string as a Postgres identifier.
data Notification Source #
An incoming notification.
Instances
| Generic Notification Source # | |
Defined in Hasql.ListenNotify Associated Types type Rep Notification :: Type -> Type # | |
| Show Notification Source # | |
Defined in Hasql.ListenNotify Methods showsPrec :: Int -> Notification -> ShowS # show :: Notification -> String # showList :: [Notification] -> ShowS # | |
| Eq Notification Source # | |
Defined in Hasql.ListenNotify | |
| type Rep Notification Source # | |
Defined in Hasql.ListenNotify type Rep Notification = D1 ('MetaData "Notification" "Hasql.ListenNotify" "hasql-listen-notify-0.1.0.1-9QQM5cfHmzE5QxjgAd2Msk" 'False) (C1 ('MetaCons "Notification" 'PrefixI 'True) (S1 ('MetaSel ('Just "channel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "payload") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "pid") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CPid)))) | |
await :: Session Notification Source #
Get the next notification received from the server.
backendPid :: Session CPid Source #
Get the PID of the backend process handling this session. This can be used to filter out notifications that originate from this session.
Notify
An outgoing notification.
Instances
| Generic Notify Source # | |
| Show Notify Source # | |
| Eq Notify Source # | |
| type Rep Notify Source # | |
Defined in Hasql.ListenNotify type Rep Notify = D1 ('MetaData "Notify" "Hasql.ListenNotify" "hasql-listen-notify-0.1.0.1-9QQM5cfHmzE5QxjgAd2Msk" 'False) (C1 ('MetaCons "Notify" 'PrefixI 'True) (S1 ('MetaSel ('Just "channel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "payload") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) | |