|
C++ Server-Side SDK
LaunchDarkly SDK
|
#include <conditions.hpp>


Public Member Functions | |
| TimedCondition (boost::asio::any_io_executor executor, std::chrono::milliseconds timeout) | |
| async::Future< Type > | Execute () 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 | |
| IFDv2Condition & | operator= (IFDv2Condition const &)=delete |
| IFDv2Condition & | operator= (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 } |
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.
|
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.
|
protected |
Cancels the active timer if armed, leaving the condition unresolved. Safe to call when no timer is armed.
|
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.
|
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.