Idris2Doc : Postgres.Notification

Postgres.Notification

(source)

Definitions

record Notification : Type
Totality: total
Visibility: public export
Constructor: 
MkNotification : String -> String -> Notification

Projections:
.channel : Notification -> String
.payload : Notification -> String
.channel : Notification -> String
Visibility: public export
channel : Notification -> String
Visibility: public export
.payload : Notification -> String
Visibility: public export
payload : Notification -> String
Visibility: public export
pgListen : String -> Conn -> IO ResultStatus
  Start listening for notifications on the given channel.

Visibility: export
pgNextNotification : Conn -> IO (Maybe Notification)
  Gets the next notification _of those sitting around locally_.
Returns `Nothing` if there are no notifications.

See `libpq` documentation on `PQnotifies` for details on the
distinction between retrieving notifications from the server and
getting the next notification that has already been retrieved.

NOTE: This function _does_ consume input to make sure no notification
sent by the server but not processed by the client yet gets
missed.

Visibility: export
pgNotificationStream : Conn -> Stream (IO Notification)
  Produce a potentially infinite stream of notifications.
Unlike `pgNextNotificaiton`, this will wait for the server
to deliver a notification.

This _is_ an infinite sequence with a blocking wait for the
next notification so it is of somewhat limited utility
compared to checking for new notifications at a natural point
in your programs existing logic loop unless your entire loop
is dictated by notification arrival anyway.

Visibility: export