libpqxx  7.0.7
pqxx::notification_receiver Class Referenceabstract

#include <notification.hxx>

Public Member Functions

 notification_receiver (connection &c, std::string_view channel)
 Register the receiver with a connection. More...
 
 notification_receiver (notification_receiver const &)=delete
 
notification_receiveroperator= (notification_receiver const &)=delete
 
virtual ~notification_receiver ()
 
std::string const & channel () const
 The channel that this receiver listens on. More...
 
virtual void operator() (std::string const &payload, int backend_pid)=0
 Overridable: action to invoke when notification arrives. More...
 

Protected Member Functions

connectionconn () const noexcept
 

Constructor & Destructor Documentation

◆ notification_receiver() [1/2]

pqxx::notification_receiver::notification_receiver ( connection c,
std::string_view  channel 
)

Register the receiver with a connection.

Parameters
cConnnection to operate on.
channelName of the notification to listen for.

Implementation of the pqxx::notification_receiever class.

pqxx::notification_receiver processes notifications.

Copyright (c) 2000-2020, Jeroen T. Vermeulen.

See COPYING for copyright license. If you did not receive a file called COPYING with this source code, please notify the distributor of this mistake, or contact the author.

References channel().

◆ notification_receiver() [2/2]

pqxx::notification_receiver::notification_receiver ( notification_receiver const &  )
delete

◆ ~notification_receiver()

pqxx::notification_receiver::~notification_receiver ( )
virtual

References conn().

Member Function Documentation

◆ channel()

std::string const& pqxx::notification_receiver::channel ( ) const

The channel that this receiver listens on.

Referenced by notification_receiver(), and pqxx::connection::trace().

◆ conn()

connection& pqxx::notification_receiver::conn ( ) const
protectednoexcept

Referenced by ~notification_receiver().

◆ operator()()

virtual void pqxx::notification_receiver::operator() ( std::string const &  payload,
int  backend_pid 
)
pure virtual

Overridable: action to invoke when notification arrives.

Parameters
payloadAn optional string that may have been passed to the NOTIFY command.
backend_pidProcess ID of the database backend process that served our connection when the notification arrived. The actual process ID behind the connection may have changed by the time this method is called.

◆ operator=()

notification_receiver& pqxx::notification_receiver::operator= ( notification_receiver const &  )
delete

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