Class: LaunchDarkly::Impl::DataStore::UpdateSink Private

Inherits:
Object
  • Object
show all
Includes:
LaunchDarkly::Interfaces::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.

Since:

  • 5.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Since:

  • 5.5.0



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

#broadcasterLaunchDarkly::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.

Returns:

Since:

  • 5.5.0



87
88
89
# File 'lib/ldclient-rb/impl/data_store/data_kind.rb', line 87

def broadcaster
  @broadcaster
end

#last_statusConcurrent::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.

Returns:

  • (Concurrent::AtomicReference)

Since:

  • 5.5.0



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.

Since:

  • 5.5.0



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