lib/ldclient-rb/config.rb in launchdarkly-server-sdk-5.8.2 vs lib/ldclient-rb/config.rb in launchdarkly-server-sdk-6.0.0

- old
+ new

@@ -13,11 +13,11 @@ # # Constructor for creating custom LaunchDarkly configurations. # # @param opts [Hash] the configuration options # @option opts [Logger] :logger See {#logger}. - # @option opts [String] :base_uri ("https://app.launchdarkly.com") See {#base_uri}. + # @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}. # @option opts [Integer] :capacity (10000) See {#capacity}. # @option opts [Float] :flush_interval (30) See {#flush_interval}. # @option opts [Float] :read_timeout (10) See {#read_timeout}. @@ -39,10 +39,11 @@ # @option opts [Object] :update_processor_factory Obsolete synonym for `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}. # @option opts [String] :wrapper_version See {#wrapper_version}. + # @option opts [#open] :socket_factory See {#socket_factory}. # def initialize(opts = {}) @base_uri = (opts[:base_uri] || Config.default_base_uri).chomp("/") @stream_uri = (opts[:stream_uri] || Config.default_stream_uri).chomp("/") @events_uri = (opts[:events_uri] || Config.default_events_uri).chomp("/") @@ -69,10 +70,11 @@ @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] @wrapper_version = opts[:wrapper_version] + @socket_factory = opts[:socket_factory] end # # The base URL for the LaunchDarkly server. This is configurable mainly for testing # purposes; most users should use the default value. @@ -304,10 +306,20 @@ # @return [String] # attr_reader :wrapper_version # + # The factory used to construct sockets for HTTP operations. The factory must + # provide the method `open(uri, timeout)`. The `open` method must return a + # connected stream that implements the `IO` class, such as a `TCPSocket`. + # + # Defaults to nil. + # @return [#open] + # + attr_reader :socket_factory + + # # The default LaunchDarkly client configuration. This configuration sets # reasonable defaults for most users. # @return [Config] The default LaunchDarkly configuration. # def self.default @@ -322,13 +334,13 @@ 10000 end # # The default value for {#base_uri}. - # @return [String] "https://app.launchdarkly.com" + # @return [String] "https://sdk.launchdarkly.com" # def self.default_base_uri - "https://app.launchdarkly.com" + "https://sdk.launchdarkly.com" end # # The default value for {#stream_uri}. # @return [String] "https://stream.launchdarkly.com"