Class: Prosody::Commands::Execute

Inherits:
Command
  • Object
show all
Defined in:
lib/prosody/processor.rb,
sig/processor.rbs

Overview

Command to execute a task with the given parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_id, carrier, event_context, block, callback, token) ⇒ Object

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^() -> void (readonly)

The block of code to execute

Returns:

  • (^() -> void)


66
67
68
# File 'lib/prosody/processor.rb', line 66

def block
  @block
end

#callback^(bool, untyped) -> bool (readonly)

Callback to invoke when execution completes or fails

Returns:

  • (^(bool, untyped) -> bool)


69
70
71
# File 'lib/prosody/processor.rb', line 69

def callback
  @callback
end

#carrierHash[String, String] (readonly)

OpenTelemetry context carrier for trace propagation

Returns:

  • (Hash[String, String])


60
61
62
# File 'lib/prosody/processor.rb', line 60

def carrier
  @carrier
end

#event_contextHash[Symbol, untyped] (readonly)

Structured event fields for error reporting

Returns:

  • (Hash[Symbol, untyped])


63
64
65
# File 'lib/prosody/processor.rb', line 63

def event_context
  @event_context
end

#task_idString (readonly)

Task identifier for logging and debugging

Returns:

  • (String)


57
58
59
# File 'lib/prosody/processor.rb', line 57

def task_id
  @task_id
end

#tokenCancellationToken (readonly)

Cancellation token for this task

Returns:



72
73
74
# File 'lib/prosody/processor.rb', line 72

def token
  @token
end