Class: LaunchDarkly::Impl::DataStore::UpdateSink Private
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::DataStore::UpdateSink
- Defined in:
- lib/ldclient-rb/impl/data_store/data_kind.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.
Instance Attribute Summary collapse
- #broadcaster ⇒ LaunchDarkly::Impl::Broadcaster readonly private
- #last_status ⇒ Concurrent::AtomicReference readonly private
Instance Method Summary collapse
-
#initialize(broadcaster) ⇒ UpdateSink
constructor
private
A new instance of UpdateSink.
- #update_status(status) ⇒ Object private
Constructor Details
#initialize(broadcaster) ⇒ UpdateSink
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 UpdateSink.
92 93 94 95 96 97 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 92 def initialize(broadcaster) @broadcaster = broadcaster @last_status = Concurrent::AtomicReference.new( LaunchDarkly::Interfaces::DataStore::Status.new(true, false) ) end |
Instance Attribute Details
#broadcaster ⇒ LaunchDarkly::Impl::Broadcaster (readonly)
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.
87 88 89 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 87 def broadcaster @broadcaster end |
#last_status ⇒ Concurrent::AtomicReference (readonly)
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.
90 91 92 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 90 def last_status @last_status end |
Instance Method Details
#update_status(status) ⇒ Object
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.
99 100 101 102 103 104 |
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 99 def update_status(status) return if status.nil? old_status = @last_status.get_and_set(status) @broadcaster.broadcast(status) unless old_status == status end |