C++ Client-Side SDK
LaunchDarkly SDK
Public Member Functions | Friends | List of all members
launchdarkly::config::shared::builders::EventsBuilder< SDK > Class Template Reference

#include <events_builder.hpp>

Public Member Functions

 EventsBuilder ()
 
EventsBuilderEnabled (bool enabled)
 
EventsBuilderDisable ()
 
EventsBuilderCapacity (std::size_t capacity)
 
EventsBuilderFlushInterval (std::chrono::milliseconds interval)
 
EventsBuilderAllAttributesPrivate (bool all_attributes_private)
 
EventsBuilderPrivateAttributes (AttributeReference::SetType private_attrs)
 
EventsBuilderPrivateAttribute (AttributeReference attribute)
 
EventsBuilderContextKeysCapacity (std::size_t capacity)
 Specifies the number of unique context keys that can be remembered by the index event generation logic before needing to evict keys from memory in LRU order. More...
 
tl::expected< built::Events, Error > Build () const
 

Friends

bool operator== (EventsBuilder< SDK > const &lhs, EventsBuilder< SDK > const &rhs)
 

Detailed Description

template<typename SDK>
class launchdarkly::config::shared::builders::EventsBuilder< SDK >

EventsBuilder allows for specification of parameters related to the SDK's event processor.

Template Parameters
SDKType of SDK, such as ClientSDK or ServerSDK.

Constructor & Destructor Documentation

◆ EventsBuilder()

Constructs an EventsBuilder.

Member Function Documentation

◆ AllAttributesPrivate()

template<typename SDK >
EventsBuilder< SDK > & launchdarkly::config::shared::builders::EventsBuilder< SDK >::AllAttributesPrivate ( bool  all_attributes_private)

Attribute privacy indicates whether or not attributes should be retained by LaunchDarkly after being sent upon initialization, and if attributes should later be sent in events.

Attribute privacy may be specified in 3 ways:

(1) To specify that all attributes should be considered private - not just those designated private on a per-context basis - call this method with true as the parameter.

(2) To specify that a specific set of attributes should be considered private - in addition to those designated private on a per-context basis

(3) To specify private attributes on a per-context basis, it is not necessary to call either of these methods, as the default behavior is to treat all attributes as non-private unless otherwise specified.

Parameters
all_attributes_privateTrue for behavior of (1), false for default behavior of (2) or (3).
Returns
Reference to this builder.

◆ Build()

template<typename SDK >
tl::expected< built::Events, Error > launchdarkly::config::shared::builders::EventsBuilder< SDK >::Build

Builds Events configuration, if the configuration is valid.

Returns
Events config, or error.

◆ Capacity()

template<typename SDK >
EventsBuilder< SDK > & launchdarkly::config::shared::builders::EventsBuilder< SDK >::Capacity ( std::size_t  capacity)

Sets the capacity of the event processor. When more events are generated within the processor's flush interval than this value, events will be dropped.

Parameters
capacityEvent queue capacity.
Returns
Reference to this builder.

◆ ContextKeysCapacity()

template<typename SDK >
EventsBuilder< SDK > & launchdarkly::config::shared::builders::EventsBuilder< SDK >::ContextKeysCapacity ( std::size_t  capacity)

Specifies the number of unique context keys that can be remembered by the index event generation logic before needing to evict keys from memory in LRU order.

After reaching capacity, it's possible that a previously-indexed context may cause generation of a redundant index event.

Parameters
capacityMaximum unique context keys to remember.
Returns
Reference to this builder.

◆ Disable()

template<typename SDK >
EventsBuilder< SDK > & launchdarkly::config::shared::builders::EventsBuilder< SDK >::Disable

Alias for Enabled(false).

Returns
Reference to this builder.

◆ Enabled()

template<typename SDK >
EventsBuilder< SDK > & launchdarkly::config::shared::builders::EventsBuilder< SDK >::Enabled ( bool  enabled)

Specify if event-sending should be enabled or not. By default, events are enabled.

Parameters
enabledTrue to enable.
Returns
Reference to this builder.

◆ FlushInterval()

template<typename SDK >
EventsBuilder< SDK > & launchdarkly::config::shared::builders::EventsBuilder< SDK >::FlushInterval ( std::chrono::milliseconds  interval)

Sets the flush interval of the event processor. The processor queues outgoing events based on the capacity parameter; these events are then delivered based on the flush interval.

Parameters
intervalInterval between automatic flushes.
Returns
Reference to this builder.

◆ PrivateAttribute()

template<typename SDK >
EventsBuilder< SDK > & launchdarkly::config::shared::builders::EventsBuilder< SDK >::PrivateAttribute ( AttributeReference  attribute)

Specifies a single private attribute. May be called multiple times with additional private attributes.

Parameters
attributeAttribute to mark private.
Returns
Reference to this builder.

◆ PrivateAttributes()

template<typename SDK >
EventsBuilder< SDK > & launchdarkly::config::shared::builders::EventsBuilder< SDK >::PrivateAttributes ( AttributeReference::SetType  private_attrs)

Specify a set of private attributes. Any existing private attributes are overwritten.

Returns
Reference to this builder.

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