Class: Liteguard::Execution
- Inherits:
-
Object
- Object
- Liteguard::Execution
- Defined in:
- lib/liteguard/decision.rb
Overview
A lightweight execution correlation handle.
Groups telemetry signals under a shared execution ID. Created by Scope#start_execution or Client#start_execution. Call #end_execution when the logical execution boundary is complete.
Instance Attribute Summary collapse
-
#execution_id ⇒ String
readonly
The unique identifier for this execution.
Instance Method Summary collapse
-
#end_execution ⇒ void
End this execution.
-
#initialize(execution_id, cleanup: nil) ⇒ Execution
constructor
private
A new instance of Execution.
Constructor Details
#initialize(execution_id, cleanup: nil) ⇒ Execution
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 Execution.
17 18 19 20 |
# File 'lib/liteguard/decision.rb', line 17 def initialize(execution_id, cleanup: nil) @execution_id = execution_id @cleanup = cleanup end |
Instance Attribute Details
#execution_id ⇒ String (readonly)
Returns the unique identifier for this execution.
14 15 16 |
# File 'lib/liteguard/decision.rb', line 14 def execution_id @execution_id end |
Instance Method Details
#end_execution ⇒ void
This method returns an undefined value.
End this execution.
After calling end_execution, subsequent guard checks will no longer be correlated with this execution.
27 28 29 30 31 32 |
# File 'lib/liteguard/decision.rb', line 27 def end_execution if @cleanup @cleanup.call @cleanup = nil end end |