Sha256: 6716a4b2f63e5a914e7858c3e0e7c6e3d4fa7113d0408bf6f88ebb49e8e8e1e6

Contents?: true

Size: 872 Bytes

Versions: 31

Compression:

Stored size: 872 Bytes

Contents

require 'concurrent/atomics'
require 'ldclient-rb/interfaces'

module LaunchDarkly
  module Impl
    module Integrations
      module TestData
        # @private
        class TestDataSource
          include LaunchDarkly::Interfaces::DataSource

          def initialize(feature_store, test_data)
            @feature_store = feature_store
            @test_data = test_data
          end

          def initialized?
            true
          end

          def start
            ready = Concurrent::Event.new
            ready.set
            init_data = @test_data.make_init_data
            @feature_store.init(init_data)
            ready
          end

          def stop
            @test_data.closed_instance(self)
          end

          def upsert(kind, item)
            @feature_store.upsert(kind, item)
          end
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
launchdarkly-server-sdk-7.0.4 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-7.0.3 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-7.0.2 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-7.0.1 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-7.0.0 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-6.4.0 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-6.3.4 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-6.3.3 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-6.3.2 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-6.3.1 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
launchdarkly-server-sdk-6.3.0 lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb