Class: LaunchDarkly::BigSegmentsConfig
- Inherits:
-
Object
- Object
- LaunchDarkly::BigSegmentsConfig
- Defined in:
- lib/ldclient-rb/config.rb
Overview
Configuration options related to Big Segments.
Big Segments are a specific type of user segments. For more information, read the LaunchDarkly documentation: docs.launchdarkly.com/home/users/big-segments
If your application uses Big Segments, you will need to create a ‘BigSegmentsConfig` that at a minimum specifies what database integration to use, and then pass the `BigSegmentsConfig` object as the `big_segments` parameter when creating a Config.
Constant Summary collapse
- DEFAULT_USER_CACHE_SIZE =
1000
- DEFAULT_USER_CACHE_TIME =
5
- DEFAULT_STATUS_POLL_INTERVAL =
5
- DEFAULT_STALE_AFTER =
2 * 60
Instance Attribute Summary collapse
-
#stale_after ⇒ Float
readonly
The maximum length of time between updates of the Big Segments data before the data is considered out of date.
-
#status_poll_interval ⇒ Float
readonly
The interval (in seconds) at which the SDK will poll the Big Segment store to make sure it is available and to determine how long ago it was updated.
-
#store ⇒ LaunchDarkly::Interfaces::BigSegmentStore
readonly
The implementation of Interfaces::BigSegmentStore that will be used to query the Big Segments database.
-
#user_cache_size ⇒ Integer
readonly
The maximum number of users whose Big Segment state will be cached by the SDK at any given time.
-
#user_cache_time ⇒ Float
readonly
The maximum length of time (in seconds) that the Big Segment state for a user will be cached by the SDK.
Instance Method Summary collapse
-
#initialize(store:, user_cache_size: nil, user_cache_time: nil, status_poll_interval: nil, stale_after: nil) ⇒ BigSegmentsConfig
constructor
Constructor for setting Big Segments options.
Constructor Details
#initialize(store:, user_cache_size: nil, user_cache_time: nil, status_poll_interval: nil, stale_after: nil) ⇒ BigSegmentsConfig
Constructor for setting Big Segments options.
569 570 571 572 573 574 575 |
# File 'lib/ldclient-rb/config.rb', line 569 def initialize(store:, user_cache_size: nil, user_cache_time: nil, status_poll_interval: nil, stale_after: nil) @store = store @user_cache_size = user_cache_size.nil? ? DEFAULT_USER_CACHE_SIZE : user_cache_size @user_cache_time = user_cache_time.nil? ? DEFAULT_USER_CACHE_TIME : user_cache_time @status_poll_interval = status_poll_interval.nil? ? DEFAULT_STATUS_POLL_INTERVAL : status_poll_interval @stale_after = stale_after.nil? ? DEFAULT_STALE_AFTER : stale_after end |
Instance Attribute Details
#stale_after ⇒ Float (readonly)
The maximum length of time between updates of the Big Segments data before the data is considered out of date.
599 600 601 |
# File 'lib/ldclient-rb/config.rb', line 599 def stale_after @stale_after end |
#status_poll_interval ⇒ Float (readonly)
The interval (in seconds) at which the SDK will poll the Big Segment store to make sure it is available and to determine how long ago it was updated.
594 595 596 |
# File 'lib/ldclient-rb/config.rb', line 594 def status_poll_interval @status_poll_interval end |
#store ⇒ LaunchDarkly::Interfaces::BigSegmentStore (readonly)
The implementation of Interfaces::BigSegmentStore that will be used to query the Big Segments database.
580 581 582 |
# File 'lib/ldclient-rb/config.rb', line 580 def store @store end |
#user_cache_size ⇒ Integer (readonly)
The maximum number of users whose Big Segment state will be cached by the SDK at any given time.
584 585 586 |
# File 'lib/ldclient-rb/config.rb', line 584 def user_cache_size @user_cache_size end |
#user_cache_time ⇒ Float (readonly)
The maximum length of time (in seconds) that the Big Segment state for a user will be cached by the SDK.
589 590 591 |
# File 'lib/ldclient-rb/config.rb', line 589 def user_cache_time @user_cache_time end |