Module: Stoplight::Domain::_DataStore
- Included in:
- Infrastructure::FailSafe::DataStore, Infrastructure::Memory::DataStore, Infrastructure::Redis::DataStore
- Defined in:
- sig/_private/stoplight/domain/ports/data_store.rbs
Instance Method Summary collapse
-
#acquire_recovery_lock ⇒ _RecoveryLockToken?
Acquires recovery lock for serializing probe execution.
-
#clear_metrics ⇒ void
Clears windowed metrics (successes/errors) to prevent stale failures from before recovery from affecting post-recovery decisions.
- #clear_recovery_metrics ⇒ void
-
#delete_light ⇒ void
Deletes metadata (and related persistent state) for the given light.
-
#get_metrics ⇒ Domain::MetricsSnapshot
Retrieves metrics for a specific light configuration.
-
#get_recovery_metrics ⇒ Domain::MetricsSnapshot
Retrieves recovery metrics for a specific light configuration.
-
#get_state_snapshot ⇒ StateSnapshot
Retrieves State Snapshot for a specific light configuration.
-
#names ⇒ Object
Retrieves the names of all lights stored in the data store.
-
#record_failure ⇒ void
Records a failure for a specific light configuration.
-
#record_recovery_probe_failure ⇒ void
Records a failed recovery probe for a specific light configuration.
-
#record_recovery_probe_success ⇒ void
Records a successful recovery probe for a specific light configuration.
-
#record_success ⇒ void
Records a success for a specific light configuration.
-
#release_recovery_lock ⇒ void
Releases previously acquired lock.
-
#set_state ⇒ state
Sets the state of a specific light configuration.
-
#transition_to_color ⇒ Boolean
Transitions the Stoplight to the specified color.
Instance Method Details
#acquire_recovery_lock ⇒ _RecoveryLockToken?
Acquires recovery lock for serializing probe execution.
43 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 43
def acquire_recovery_lock: (Config) -> _RecoveryLockToken?
|
#clear_metrics ⇒ void
This method returns an undefined value.
Clears windowed metrics (successes/errors) to prevent stale failures from before recovery from affecting post-recovery decisions. Consecutive counts are intentionally preserved as they track current streaks.
23 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 23
def clear_metrics: (Config) -> void
|
#clear_recovery_metrics ⇒ void
This method returns an undefined value.
25 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 25
def clear_recovery_metrics: (Config) -> void
|
#delete_light ⇒ void
This method returns an undefined value.
Deletes metadata (and related persistent state) for the given light.
Implementations may choose to only remove metadata; metrics may expire via TTL.
73 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 73
def delete_light: (Config) -> void
|
#get_metrics ⇒ Domain::MetricsSnapshot
Retrieves metrics for a specific light configuration.
12 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 12
def get_metrics: (Config) -> Domain::MetricsSnapshot
|
#get_recovery_metrics ⇒ Domain::MetricsSnapshot
Retrieves recovery metrics for a specific light configuration.
15 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 15
def get_recovery_metrics: (Config) -> Domain::MetricsSnapshot
|
#get_state_snapshot ⇒ StateSnapshot
Retrieves State Snapshot for a specific light configuration.
18 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 18
def get_state_snapshot: (Config) -> StateSnapshot
|
#names ⇒ Object
Retrieves the names of all lights stored in the data store.
9 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 9
def names: -> Array[String]
|
#record_failure ⇒ void
This method returns an undefined value.
Records a failure for a specific light configuration.
28 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 28
def record_failure: (Config, StandardError exception) -> void
|
#record_recovery_probe_failure ⇒ void
This method returns an undefined value.
Records a failed recovery probe for a specific light configuration.
34 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 34
def record_recovery_probe_failure: (Config, StandardError exception) -> void
|
#record_recovery_probe_success ⇒ void
This method returns an undefined value.
Records a successful recovery probe for a specific light configuration.
37 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 37
def record_recovery_probe_success: (Config) -> void
|
#record_success ⇒ void
This method returns an undefined value.
Records a success for a specific light configuration.
31 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 31
def record_success: (Config) -> void
|
#release_recovery_lock ⇒ void
This method returns an undefined value.
Releases previously acquired lock.
46 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 46
def release_recovery_lock: (_RecoveryLockToken lock) -> void
|
#set_state ⇒ state
Sets the state of a specific light configuration.
40 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 40
def set_state: (Config, state state) -> state
|
#transition_to_color ⇒ Boolean
In distributed environments with multiple instances, race conditions can occur when instances attempt conflicting transitions simultaneously (e.g., one instance tries to transition from YELLOW to GREEN while another tries YELLOW to RED). The implementation handles this, but be aware that the last operation may determine the final color of the light.
Transitions the Stoplight to the specified color.
This method performs a color transition operation that works across distributed instances of the light. It ensures that in a multi-instance environment, only one instance is considered the "first" to perform the transition (and therefore responsible for triggering notifications).
68 |
# File 'sig/_private/stoplight/domain/ports/data_store.rbs', line 68
def transition_to_color: (Config, color color) -> bool
|