|
void | Add (std::string const &key, TimePoint expiration) |
|
void | Remove (std::string const &key) |
|
TrackState | State (std::string const &key, TimePoint current_time) const |
|
void | Add (DataKind kind, std::string const &key, TimePoint expiration) |
|
void | Remove (DataKind kind, std::string const &key) |
|
TrackState | State (DataKind kind, std::string const &key, TimePoint current_time) const |
|
void | Clear () |
|
std::vector< std::pair< std::optional< DataKind >, std::string > > | Prune (TimePoint current_time) |
|
◆ TrackState
The state of the key in the tracker.
Enumerator |
---|
kFresh | The key is tracked and the key expiration is in the future.
|
kStale | The key is tracked and the expiration is either now or in the past.
|
kNotTracked | The key is not being tracked.
|
◆ Add() [1/2]
void launchdarkly::server_side::data_components::ExpirationTracker::Add |
( |
DataKind |
kind, |
|
|
std::string const & |
key, |
|
|
TimePoint |
expiration |
|
) |
| |
Add a scoped key to the tracker. Will use the specified TTL for the kind.
- Parameters
-
kind | The scope (kind) of the key. |
key | The key to track. |
expiration | The time that the key expires. |
◆ Add() [2/2]
void launchdarkly::server_side::data_components::ExpirationTracker::Add |
( |
std::string const & |
key, |
|
|
TimePoint |
expiration |
|
) |
| |
Add an unscoped key to the tracker.
- Parameters
-
key | The key to track. |
expiration | The time that the key expires. used. |
◆ Clear()
void launchdarkly::server_side::data_components::ExpirationTracker::Clear |
( |
| ) |
|
◆ Prune()
std::vector< std::pair< std::optional< DataKind >, std::string > > launchdarkly::server_side::data_components::ExpirationTracker::Prune |
( |
TimePoint |
current_time | ) |
|
Prune expired keys from the tracker.
- Parameters
-
current_time | The current time. |
- Returns
- A list of all the kinds and associated keys that expired. Unscoped keys will have std::nullopt as the kind.
◆ Remove() [1/2]
void launchdarkly::server_side::data_components::ExpirationTracker::Remove |
( |
DataKind |
kind, |
|
|
std::string const & |
key |
|
) |
| |
Remove a scoped key from the tracker.
- Parameters
-
kind | The scope (kind) of the key. |
key | The key to stop tracking. |
◆ Remove() [2/2]
void launchdarkly::server_side::data_components::ExpirationTracker::Remove |
( |
std::string const & |
key | ) |
|
Remove an unscoped key from the tracker.
- Parameters
-
key | The key to stop tracking. |
◆ State() [1/2]
ExpirationTracker::TrackState launchdarkly::server_side::data_components::ExpirationTracker::State |
( |
DataKind |
kind, |
|
|
std::string const & |
key, |
|
|
TimePoint |
current_time |
|
) |
| const |
Check the state of a scoped key.
- Parameters
-
kind | The scope (kind) of the key. |
key | The key to check. |
- Returns
- The state of the key.
◆ State() [2/2]
ExpirationTracker::TrackState launchdarkly::server_side::data_components::ExpirationTracker::State |
( |
std::string const & |
key, |
|
|
TimePoint |
current_time |
|
) |
| const |
Check the state of an unscoped key.
- Parameters
-
key | The key to check. |
current_time | The current time. |
- Returns
- The state of the key.
The documentation for this class was generated from the following files:
- src/data_components/expiration_tracker/expiration_tracker.hpp
- src/data_components/expiration_tracker/expiration_tracker.cpp