Class: Prosody::Commands::Execute
- Defined in:
- lib/prosody/processor.rb
Overview
Command to execute a task with the given parameters.
This command encapsulates all the information needed to execute an asynchronous task in the Ruby runtime.
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
The block of code to execute.
-
#callback ⇒ Object
readonly
Callback to invoke when execution completes or fails.
-
#carrier ⇒ Object
readonly
OpenTelemetry context carrier for trace propagation.
-
#event_context ⇒ Object
readonly
Structured event context for error reporting.
-
#task_id ⇒ Object
readonly
Task identifier for logging and debugging.
-
#token ⇒ Object
readonly
Cancellation token for this task.
Instance Method Summary collapse
-
#initialize(task_id, carrier, event_context, block, callback, token) ⇒ Execute
constructor
Creates a new execute command with all required parameters.
Constructor Details
#initialize(task_id, carrier, event_context, block, callback, token) ⇒ Execute
Creates a new execute command with all required parameters.
82 83 84 85 86 87 88 89 |
# File 'lib/prosody/processor.rb', line 82 def initialize(task_id, carrier, event_context, block, callback, token) @task_id = task_id @carrier = carrier @event_context = event_context @block = block @callback = callback @token = token end |
Instance Attribute Details
#block ⇒ Object (readonly)
The block of code to execute
66 67 68 |
# File 'lib/prosody/processor.rb', line 66 def block @block end |
#callback ⇒ Object (readonly)
Callback to invoke when execution completes or fails
69 70 71 |
# File 'lib/prosody/processor.rb', line 69 def callback @callback end |
#carrier ⇒ Object (readonly)
OpenTelemetry context carrier for trace propagation
60 61 62 |
# File 'lib/prosody/processor.rb', line 60 def carrier @carrier end |
#event_context ⇒ Object (readonly)
Structured event context for error reporting
63 64 65 |
# File 'lib/prosody/processor.rb', line 63 def event_context @event_context end |
#task_id ⇒ Object (readonly)
Task identifier for logging and debugging
57 58 59 |
# File 'lib/prosody/processor.rb', line 57 def task_id @task_id end |
#token ⇒ Object (readonly)
Cancellation token for this task
72 73 74 |
# File 'lib/prosody/processor.rb', line 72 def token @token end |