userver: storages::postgres::NotifyScope Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
storages::postgres::NotifyScope Class Referencefinal

#include <userver/storages/postgres/notify.hpp>

Detailed Description

RAII scope for receiving notifications.

Used for waiting for notifications on PostgreSQL connections. Created by calling storages::postgres::Cluster::Listen(). Exclusively holds a connection from a pool.

Non-copyable.

Usage synopsis
auto scope = cluster.Listen("channel");
cluster.Execute(pg::ClusterHostType::kMaster,
"select pg_notify('channel', NULL)");
auto ntf = scope.WaitNotify(engine::Deadline::FromDuration(100ms));

Definition at line 37 of file notify.hpp.

Public Member Functions

 NotifyScope (detail::ConnectionPtr conn, std::string_view channel, OptionalCommandControl cmd_ctl)
 
 NotifyScope (NotifyScope &&) noexcept
 
NotifyScopeoperator= (NotifyScope &&) noexcept
 
 NotifyScope (const NotifyScope &)=delete
 
NotifyScopeoperator= (const NotifyScope &)=delete
 
Notification WaitNotify (engine::Deadline deadline)
 Wait for notification on connection.
 

The documentation for this class was generated from the following file: