C++ Server-Side SDK
LaunchDarkly SDK
Classes | Public Member Functions | Protected Member Functions | List of all members
launchdarkly::server_side::data_systems::TimedCondition Class Reference

#include <conditions.hpp>

Inheritance diagram for launchdarkly::server_side::data_systems::TimedCondition:
Inheritance graph
[legend]
Collaboration diagram for launchdarkly::server_side::data_systems::TimedCondition:
Collaboration graph
[legend]

Public Member Functions

 TimedCondition (boost::asio::any_io_executor executor, std::chrono::milliseconds timeout)
 
async::Future< TypeExecute () override
 
void Close () override
 
- Public Member Functions inherited from launchdarkly::server_side::data_interfaces::IFDv2Condition
virtual void Inform (FDv2SourceResult const &result)=0
 
virtual Type GetType () const =0
 
 IFDv2Condition (IFDv2Condition const &)=delete
 
 IFDv2Condition (IFDv2Condition &&)=delete
 
IFDv2Conditionoperator= (IFDv2Condition const &)=delete
 
IFDv2Conditionoperator= (IFDv2Condition &&)=delete
 

Protected Member Functions

void ArmTimer ()
 
void CancelTimer ()
 

Additional Inherited Members

- Public Types inherited from launchdarkly::server_side::data_interfaces::IFDv2Condition
enum class  Type { kFallback , kRecovery , kCancelled }
 

Detailed Description

Base class for conditions that fire after a duration elapses on the orchestrator's executor. Owns the result promise, the cancellation handle for the active timer (if any), and the state required to safely arm, cancel, and resolve the timer across threads.

Derived classes implement Inform() to translate orchestrator events into arm/cancel actions on the timer. Subclasses also implement GetType() to report whether they are a fallback or recovery condition.

Member Function Documentation

◆ ArmTimer()

void launchdarkly::server_side::data_systems::TimedCondition::ArmTimer ( )
protected

Arms the timer if not already armed. When the timer fires, the condition's future resolves with GetType(). Safe to call concurrently; a no-op if a timer is already armed or the condition is closed.

◆ CancelTimer()

void launchdarkly::server_side::data_systems::TimedCondition::CancelTimer ( )
protected

Cancels the active timer if armed, leaving the condition unresolved. Safe to call when no timer is armed.

◆ Close()

void launchdarkly::server_side::data_systems::TimedCondition::Close ( )
overridevirtual

Cancels any pending internal work and resolves the future returned by Execute() with kCancelled if it has not already resolved. Idempotent.

Implements launchdarkly::server_side::data_interfaces::IFDv2Condition.

◆ Execute()

async::Future< IFDv2Condition::Type > launchdarkly::server_side::data_systems::TimedCondition::Execute ( )
overridevirtual

Returns a Future that resolves with the condition's Type once the condition's criteria are satisfied. May be called multiple times; each call returns a Future referring to the same underlying state.

Implements launchdarkly::server_side::data_interfaces::IFDv2Condition.


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