pulsar-client-cpp
Loading...
Searching...
No Matches
pulsar::ServiceInfoProvider Class Referenceabstract
Inheritance diagram for pulsar::ServiceInfoProvider:
pulsar::AutoClusterFailover

Public Member Functions

virtual ~ServiceInfoProvider ()=default
virtual ServiceInfo initialServiceInfo ()=0
virtual void initialize (std::function< void(ServiceInfo)> onServiceInfoUpdate)=0

Constructor & Destructor Documentation

◆ ~ServiceInfoProvider()

virtual pulsar::ServiceInfoProvider::~ServiceInfoProvider ( )
virtualdefault

The destructor will be called when Client::close() is invoked, and the provider should stop any ongoing work and release the resources in the destructor.

Member Function Documentation

◆ initialize()

virtual void pulsar::ServiceInfoProvider::initialize ( std::function< void(ServiceInfo)> onServiceInfoUpdate)
pure virtual

Initialize the ServiceInfoProvider.

After the client has obtained the initial ServiceInfo via initialServiceInfo, this method is called to allow the provider to start any background work (for example, service discovery or watching configuration changes) and to report subsequent updates to the service information.

Parameters
onServiceInfoUpdatethe callback to deliver updated ServiceInfo values to the client after the initial connection has been established

Implementations may choose not to invoke onServiceInfoUpdate if the ServiceInfo never changes.

Implemented in pulsar::AutoClusterFailover.

◆ initialServiceInfo()

virtual ServiceInfo pulsar::ServiceInfoProvider::initialServiceInfo ( )
pure virtual

Get the initial ServiceInfo connection for the client. This method is called only once internally in Client::create() to get the initial ServiceInfo for the client to connect to the Pulsar service, typically before initialize is invoked. Since it's only called once, it's legal to return a moved ServiceInfo object to avoid unnecessary copying.

Implemented in pulsar::AutoClusterFailover.


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