LogDevice API
Public Member Functions | List of all members
facebook::logdevice::ConfigSubscriptionHandle Class Referencefinal

#include <ConfigSubscriptionHandle.h>

Public Member Functions

 ConfigSubscriptionHandle () noexcept=default
 ConfigSubscriptionHandle (configuration::UpdateableConfigBase *owner, configuration::subscription_id_t sub_id) noexcept
 ~ConfigSubscriptionHandle () noexcept
 ConfigSubscriptionHandle (ConfigSubscriptionHandle &&other) noexcept
ConfigSubscriptionHandleoperator= (ConfigSubscriptionHandle &&other) noexcept
void unsubscribe () noexcept
void swap (ConfigSubscriptionHandle &other) noexcept

Detailed Description

An interface for the handle for client-side subscriptions to config updates. Contains no usable methods. Automatically unsubscribes itself on destruction (RAII).

Can be moved but not copied.

Constructor & Destructor Documentation

◆ ConfigSubscriptionHandle() [1/3]

facebook::logdevice::ConfigSubscriptionHandle::ConfigSubscriptionHandle ( )

Default constructor. Creates a subscription handle without owner. Useful for move-assignment at a later point.

◆ ConfigSubscriptionHandle() [2/3]

facebook::logdevice::ConfigSubscriptionHandle::ConfigSubscriptionHandle ( configuration::UpdateableConfigBase *  owner,
configuration::subscription_id_t  sub_id 

Constructor for a valid subscription handle.

ownerConfiguration from where to unsubscribe at destruction.
sub_idThe internal subscription ID generated from UpdateableConfig

◆ ~ConfigSubscriptionHandle()

facebook::logdevice::ConfigSubscriptionHandle::~ConfigSubscriptionHandle ( )

Destructor. Unsubscribes from owner, if any. If callback is running now, blocks until the callback returns.

◆ ConfigSubscriptionHandle() [3/3]

facebook::logdevice::ConfigSubscriptionHandle::ConfigSubscriptionHandle ( ConfigSubscriptionHandle &&  other)

Move constructor. Releases other.

Member Function Documentation

◆ operator=()

ConfigSubscriptionHandle& facebook::logdevice::ConfigSubscriptionHandle::operator= ( ConfigSubscriptionHandle &&  other)

Move-assignment operator. Unsubscribes this and releases other.

◆ swap()

void facebook::logdevice::ConfigSubscriptionHandle::swap ( ConfigSubscriptionHandle other)

Swap two subscription handles.

◆ unsubscribe()

void facebook::logdevice::ConfigSubscriptionHandle::unsubscribe ( )

Unsubscribe now. Useful if one wants to unsubscribe before or without destroying the handle.

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