-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathtest_data_source.rb
More file actions
39 lines (33 loc) · 853 Bytes
/
test_data_source.rb
File metadata and controls
39 lines (33 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'concurrent/atomics'
require 'ldclient-rb/interfaces'
module LaunchDarkly
module Impl
module Integrations
module TestData
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