lib/ldclient-rb/config.rb in launchdarkly-server-sdk-7.3.3 vs lib/ldclient-rb/config.rb in launchdarkly-server-sdk-8.0.0
- old
+ new
@@ -11,22 +11,10 @@
# rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
#
# Constructor for creating custom LaunchDarkly configurations.
#
- # `user_keys_capacity` and `user_keys_flush_interval` are deprecated
- # configuration options. They exist to maintain backwards compatibility
- # with previous configurations. Newer code should prefer their replacement
- # options -- `context_keys_capacity` and `context_keys_flush_interval`.
- #
- # In the event both the user and context variations are provided, the
- # context specific configuration option will take precedence.
- #
- # Similarly, `private_attribute_names` is deprecated. Newer code should
- # prefer `private_attributes`. If both are provided, `private_attributes`
- # will take precedence.
- #
# @param opts [Hash] the configuration options
# @option opts [Logger] :logger See {#logger}.
# @option opts [String] :base_uri ("https://sdk.launchdarkly.com") See {#base_uri}.
# @option opts [String] :stream_uri ("https://stream.launchdarkly.com") See {#stream_uri}.
# @option opts [String] :events_uri ("https://events.launchdarkly.com") See {#events_uri}.
@@ -40,16 +28,13 @@
# @option opts [Boolean] :use_ldd (false) See {#use_ldd?}.
# @option opts [Boolean] :offline (false) See {#offline?}.
# @option opts [Float] :poll_interval (30) See {#poll_interval}.
# @option opts [Boolean] :stream (true) See {#stream?}.
# @option opts [Boolean] all_attributes_private (false) See {#all_attributes_private}.
- # @option opts [Array] :private_attribute_names See {#private_attribute_names}.
# @option opts [Array] :private_attributes See {#private_attributes}.
# @option opts [Boolean] :send_events (true) See {#send_events}.
- # @option opts [Integer] :user_keys_capacity (1000) See {#user_keys_capacity}.
# @option opts [Integer] :context_keys_capacity (1000) See {#context_keys_capacity}.
- # @option opts [Float] :user_keys_flush_interval (300) See {#user_keys_flush_interval}.
# @option opts [Float] :context_keys_flush_interval (300) See {#context_keys_flush_interval}.
# @option opts [Object] :data_source See {#data_source}.
# @option opts [Boolean] :diagnostic_opt_out (false) See {#diagnostic_opt_out?}.
# @option opts [Float] :diagnostic_recording_interval (900) See {#diagnostic_recording_interval}.
# @option opts [String] :wrapper_name See {#wrapper_name}.
@@ -74,14 +59,14 @@
@stream = opts.has_key?(:stream) ? opts[:stream] : Config.default_stream
@use_ldd = opts.has_key?(:use_ldd) ? opts[:use_ldd] : Config.default_use_ldd
@offline = opts.has_key?(:offline) ? opts[:offline] : Config.default_offline
@poll_interval = opts.has_key?(:poll_interval) && opts[:poll_interval] > Config.default_poll_interval ? opts[:poll_interval] : Config.default_poll_interval
@all_attributes_private = opts[:all_attributes_private] || false
- @private_attributes = opts[:private_attributes] || opts[:private_attribute_names] || []
+ @private_attributes = opts[:private_attributes] || []
@send_events = opts.has_key?(:send_events) ? opts[:send_events] : Config.default_send_events
- @context_keys_capacity = opts[:context_keys_capacity] || opts[:user_keys_capacity] || Config.default_context_keys_capacity
- @context_keys_flush_interval = opts[:context_keys_flush_interval] || opts[:user_keys_flush_interval] || Config.default_user_keys_flush_interval
+ @context_keys_capacity = opts[:context_keys_capacity] || Config.default_context_keys_capacity
+ @context_keys_flush_interval = opts[:context_keys_flush_interval] || Config.default_context_keys_flush_interval
@data_source = opts[:data_source]
@diagnostic_opt_out = opts.has_key?(:diagnostic_opt_out) && opts[:diagnostic_opt_out]
@diagnostic_recording_interval = opts.has_key?(:diagnostic_recording_interval) && opts[:diagnostic_recording_interval] > Config.minimum_diagnostic_recording_interval ?
opts[:diagnostic_recording_interval] : Config.default_diagnostic_recording_interval
@wrapper_name = opts[:wrapper_name]
@@ -257,18 +242,10 @@
# @see #all_attributes_private
#
attr_reader :private_attributes
#
- # @deprecated Backwards compatibility alias for #private_attributes.
- #
- # @return [Integer]
- # @see #private_attributes
- #
- alias :private_attribute_names :private_attributes
-
- #
# Whether to send events back to LaunchDarkly. This differs from {#offline?} in that it affects
# only the sending of client-side events, not streaming or polling for events from the server.
# @return [Boolean]
#
attr_reader :send_events
@@ -280,33 +257,17 @@
# @see #context_keys_flush_interval
#
attr_reader :context_keys_capacity
#
- # @deprecated Backwards compatibility alias for #context_keys_capacity.
- #
- # @return [Integer]
- # @see #context_keys_flush_interval
- #
- alias :user_keys_capacity :context_keys_capacity
-
- #
# The interval in seconds at which the event processor will reset its set of known context keys.
# @return [Float]
# @see #context_keys_capacity
#
attr_reader :context_keys_flush_interval
#
- # @deprecated Backwards compatibility alias for #context_keys_flush_interval.
- #
- # @return [Integer]
- # @see #context_keys_flush_interval
- #
- alias :user_keys_flush_interval :context_keys_flush_interval
-
- #
# An object that is responsible for receiving feature flag data from LaunchDarkly. By default,
# the client uses its standard polling or streaming implementation; this is customizable for
# testing purposes.
#
# This may be set to either an object that conforms to {LaunchDarkly::Interfaces::DataSource},
@@ -568,22 +529,10 @@
#
def self.default_context_keys_flush_interval
300
end
- class << self
- #
- # @deprecated Backwards compatibility alias for #default_context_keys_capacity
- #
- alias :default_user_keys_capacity :default_context_keys_capacity
-
- #
- # @deprecated Backwards compatibility alias for #default_context_keys_flush_interval
- #
- alias :default_user_keys_flush_interval :default_context_keys_flush_interval
- end
-
#
# The default value for {#diagnostic_recording_interval}.
# @return [Float] 900
#
def self.default_diagnostic_recording_interval
@@ -645,27 +594,13 @@
# The maximum number of contexts whose Big Segment state will be cached by the SDK at any given time.
# @return [Integer]
attr_reader :context_cache_size
- #
- # @deprecated Backwards compatibility alias for #context_cache_size
- #
- # @return [Integer]
- #
- alias :user_cache_size :context_cache_size
-
# The maximum length of time (in seconds) that the Big Segment state for a context will be cached
# by the SDK.
# @return [Float]
attr_reader :context_cache_time
-
- #
- # @deprecated Backwards compatibility alias for #context_cache_time
- #
- # @return [Float]
- #
- alias :user_cache_time :context_cache_time
# 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.
# @return [Float]
attr_reader :status_poll_interval