Class: LaunchDarkly::Interfaces::DataSource::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/interfaces.rb

Overview

Information about the data source’s status and about the last status change.

Constant Summary collapse

INITIALIZING =

The initial state of the data source when the SDK is being initialized.

If it encounters an error that requires it to retry initialization, the state will remain at INITIALIZING until it either succeeds and becomes VALID, or permanently fails and becomes OFF.

:initializing
VALID =

Indicates that the data source is currently operational and has not had any problems since the last time it received data.

In streaming mode, this means that there is currently an open stream connection and that at least one initial message has been received on the stream. In polling mode, it means that the last poll request succeeded.

:valid
INTERRUPTED =

Indicates that the data source encountered an error that it will attempt to recover from.

In streaming mode, this means that the stream connection failed, or had to be dropped due to some other error, and will be retried after a backoff delay. In polling mode, it means that the last poll request failed, and a new poll request will be made after the configured polling interval.

:interrupted
OFF =

Indicates that the data source has been permanently shut down.

This could be because it encountered an unrecoverable error (for instance, the LaunchDarkly service rejected the SDK key; an invalid SDK key will never become valid), or because the SDK client was explicitly shut down.

:off

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state, state_since, last_error) ⇒ Status

Returns a new instance of Status.



733
734
735
736
737
# File 'lib/ldclient-rb/interfaces.rb', line 733

def initialize(state, state_since, last_error)
  @state = state
  @state_since = state_since
  @last_error = last_error
end

Instance Attribute Details

#last_errorErrorInfo? (readonly)

Returns a description of the last error or nil if no errors have occurred since startup.

Returns:

  • (ErrorInfo, nil)

    a description of the last error or nil if no errors have occurred since startup



731
732
733
# File 'lib/ldclient-rb/interfaces.rb', line 731

def last_error
  @last_error
end

#stateSymbol (readonly)

Returns The basic state.

Returns:

  • (Symbol)

    The basic state



727
728
729
# File 'lib/ldclient-rb/interfaces.rb', line 727

def state
  @state
end

#state_sinceTime (readonly)

Returns timestamp of the last state transition.

Returns:

  • (Time)

    timestamp of the last state transition



729
730
731
# File 'lib/ldclient-rb/interfaces.rb', line 729

def state_since
  @state_since
end