Class: Phronomy::Runtime::ShutdownResult Private
- Inherits:
-
Object
- Object
- Phronomy::Runtime::ShutdownResult
- Defined in:
- lib/phronomy/engine/runtime/shutdown_result.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.
Immutable result returned by #shutdown.
runtime_outcome records whether execution remained healthy. It is
intentionally independent from cleanup_status: a Runtime may fail
during execution but still release every owned resource successfully.
Instance Attribute Summary collapse
- #cleanup_status ⇒ Object readonly private
- #error ⇒ Object readonly private
- #event_loop_status ⇒ Object readonly private
- #runtime_outcome ⇒ Object readonly private
- #task_registry_status ⇒ Object readonly private
Class Method Summary collapse
- .not_started ⇒ Object private
Instance Method Summary collapse
-
#clean? ⇒ Boolean
private
Returns true only for a graceful, error-free shutdown.
-
#cleanup_complete? ⇒ Boolean
private
Returns true when every Runtime-owned resource is known to have stopped.
-
#initialize(runtime_outcome:, cleanup_status:, event_loop_status:, task_registry_status:, error: nil) ⇒ ShutdownResult
constructor
private
A new instance of ShutdownResult.
-
#success? ⇒ Boolean
private
Runtime reset is safe when cleanup completed, even if execution failed.
Constructor Details
#initialize(runtime_outcome:, cleanup_status:, event_loop_status:, task_registry_status:, error: nil) ⇒ ShutdownResult
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 ShutdownResult.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 27 def initialize( runtime_outcome:, cleanup_status:, event_loop_status:, task_registry_status:, error: nil ) @runtime_outcome = runtime_outcome @cleanup_status = cleanup_status @event_loop_status = event_loop_status @task_registry_status = task_registry_status @error = error freeze end |
Instance Attribute Details
#cleanup_status ⇒ Object (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.
12 13 14 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 12 def cleanup_status @cleanup_status end |
#error ⇒ Object (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.
12 13 14 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 12 def error @error end |
#event_loop_status ⇒ Object (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.
12 13 14 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 12 def event_loop_status @event_loop_status end |
#runtime_outcome ⇒ Object (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.
12 13 14 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 12 def runtime_outcome @runtime_outcome end |
#task_registry_status ⇒ Object (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.
12 13 14 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 12 def task_registry_status @task_registry_status end |
Class Method Details
.not_started ⇒ 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.
18 19 20 21 22 23 24 25 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 18 def self.not_started new( runtime_outcome: :terminated, cleanup_status: :complete, event_loop_status: :not_started, task_registry_status: :empty ) end |
Instance Method Details
#clean? ⇒ Boolean
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 true only for a graceful, error-free shutdown. A cancellation may release every resource, but is not considered clean.
49 50 51 52 53 54 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 49 def clean? @runtime_outcome == :terminated && @cleanup_status == :complete && %i[not_started terminated].include?(@event_loop_status) && @task_registry_status == :empty end |
#cleanup_complete? ⇒ Boolean
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 true when every Runtime-owned resource is known to have stopped.
43 44 45 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 43 def cleanup_complete? @cleanup_status == :complete end |
#success? ⇒ Boolean
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.
Runtime reset is safe when cleanup completed, even if execution failed.
57 58 59 |
# File 'lib/phronomy/engine/runtime/shutdown_result.rb', line 57 def success? cleanup_complete? end |