Module: LaunchDarkly::DataSystem::DataSourceBuilderCommon
- Defined in:
- lib/ldclient-rb/data_system/data_source_builder_common.rb
Overview
Common HTTP configuration methods shared by all data source builders.
This module is included by PollingDataSourceBuilder, FDv1PollingDataSourceBuilder, and StreamingDataSourceBuilder to provide a consistent set of HTTP connection settings.
Each builder that includes this module must define a +DEFAULT_BASE_URI+ constant which is used as the fallback when #base_uri has not been called.
Instance Method Summary collapse
-
#base_uri(uri) ⇒ self
Sets the base URI for HTTP requests.
-
#connect_timeout(timeout) ⇒ self
Sets the connect timeout for HTTP connections.
-
#read_timeout(timeout) ⇒ self
Sets the read timeout for HTTP connections.
-
#socket_factory(factory) ⇒ self
Sets a custom socket factory for HTTP connections.
Instance Method Details
#base_uri(uri) ⇒ self
Sets the base URI for HTTP requests.
Use this to point the SDK at a Relay Proxy instance or any other URI that implements the corresponding LaunchDarkly API.
27 28 29 30 |
# File 'lib/ldclient-rb/data_system/data_source_builder_common.rb', line 27 def base_uri(uri) @base_uri = uri self end |
#connect_timeout(timeout) ⇒ self
Sets the connect timeout for HTTP connections.
60 61 62 63 |
# File 'lib/ldclient-rb/data_system/data_source_builder_common.rb', line 60 def connect_timeout(timeout) @connect_timeout = timeout self end |
#read_timeout(timeout) ⇒ self
Sets the read timeout for HTTP connections.
49 50 51 52 |
# File 'lib/ldclient-rb/data_system/data_source_builder_common.rb', line 49 def read_timeout(timeout) @read_timeout = timeout self end |
#socket_factory(factory) ⇒ self
Sets a custom socket factory for HTTP connections.
38 39 40 41 |
# File 'lib/ldclient-rb/data_system/data_source_builder_common.rb', line 38 def socket_factory(factory) @socket_factory = factory self end |