Postgres module

wait_for_notification

procedure · 1 overloadsince 0.27.0Source

The oldest queued notification, or the next one to arrive: blocks the fiber until then, within any Io.with_deadline or Io.cancel (the error is .TIMED_OUT or .CANCELED, and the connection stays usable). Free the notification with free_notification. Nothing else may use the connection while a fiber waits on it. With on_notification set, notifications never queue, so there is nothing to wait for.

wait_for_notification :: (c: *Connection) -> (Notification, Pg_Error)

The oldest queued notification, or the next one to arrive: blocks the fiber until then, within any Io.with_deadline or Io.cancel (the error is .TIMED_OUT or .CANCELED, and the connection stays usable). Free the notification with free_notification. Nothing else may use the connection while a fiber waits on it. With on_notification set, notifications never queue, so there is nothing to wait for.

Parameters

c: *Connection
the connection that LISTENs.

Returns

See also