-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathnull_processor.rb
More file actions
53 lines (48 loc) · 1.24 KB
/
null_processor.rb
File metadata and controls
53 lines (48 loc) · 1.24 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'concurrent'
module LaunchDarkly
module Impl
module DataSource
#
# A minimal UpdateProcessor implementation used when the SDK is in offline mode
# or daemon (LDD) mode. It does nothing except mark itself as initialized.
#
# @private
#
class NullUpdateProcessor
include LaunchDarkly::Interfaces::DataSource
#
# Creates a new NullUpdateProcessor.
#
def initialize
@ready = Concurrent::Event.new
end
#
# Starts the data source. Since this is a null implementation, it immediately
# sets the ready event to indicate initialization is complete.
#
# @return [Concurrent::Event] The ready event
#
def start
@ready.set
@ready
end
#
# Stops the data source. This is a no-op for the null implementation.
#
# @return [void]
#
def stop
# Nothing to do
end
#
# Checks if the data source has been initialized.
#
# @return [Boolean] Always returns true since this is a null implementation
#
def initialized?
true
end
end
end
end
end