Class: LaunchDarkly::Impl::DataSource::Requestor Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/impl/data_source/requestor.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0

Defined Under Namespace

Classes: CacheEntry

Instance Method Summary collapse

Constructor Details

#initialize(sdk_key, config) ⇒ Requestor

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Requestor.

Since:

  • 5.5.0



26
27
28
29
30
31
32
33
# File 'lib/ldclient-rb/impl/data_source/requestor.rb', line 26

def initialize(sdk_key, config)
  @sdk_key = sdk_key
  @config = config
  @http_client = Impl::Util.new_http_client(config.base_uri, config)
    .use(:auto_inflate)
    .headers("Accept-Encoding" => "gzip")
  @cache = @config.cache_store
end

Instance Method Details

#request_all_dataObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0



35
36
37
38
# File 'lib/ldclient-rb/impl/data_source/requestor.rb', line 35

def request_all_data()
  all_data = JSON.parse(make_request("/sdk/latest-all"), symbolize_names: true)
  Impl::Model.make_all_store_data(all_data, @config.logger)
end

#stopObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0



40
41
42
43
44
45
# File 'lib/ldclient-rb/impl/data_source/requestor.rb', line 40

def stop
  begin
    @http_client.close
  rescue
  end
end