Class: Freddy::Delivery
- Inherits:
-
Object
- Object
- Freddy::Delivery
- Defined in:
- lib/freddy/delivery.rb
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#routing_key ⇒ Object
readonly
Returns the value of attribute routing_key.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
- #correlation_id ⇒ Object
- #in_span(&block) ⇒ Object
-
#initialize(payload, metadata, routing_key, tag, exchange) ⇒ Delivery
constructor
A new instance of Delivery.
- #reply_to ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(payload, metadata, routing_key, tag, exchange) ⇒ Delivery
Returns a new instance of Delivery.
7 8 9 10 11 12 13 |
# File 'lib/freddy/delivery.rb', line 7 def initialize(payload, , routing_key, tag, exchange) @payload = payload = @routing_key = routing_key @tag = tag @exchange = exchange end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
5 6 7 |
# File 'lib/freddy/delivery.rb', line 5 def payload @payload end |
#routing_key ⇒ Object (readonly)
Returns the value of attribute routing_key.
5 6 7 |
# File 'lib/freddy/delivery.rb', line 5 def routing_key @routing_key end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
5 6 7 |
# File 'lib/freddy/delivery.rb', line 5 def tag @tag end |
Instance Method Details
#correlation_id ⇒ Object
15 16 17 |
# File 'lib/freddy/delivery.rb', line 15 def correlation_id .correlation_id end |
#in_span(&block) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/freddy/delivery.rb', line 27 def in_span(&block) name = "#{Tracing.span_destination(@exchange, @routing_key)} process" kind = OpenTelemetry::Trace::SpanKind::CONSUMER producer_context = OpenTelemetry.propagation.extract([:headers] || {}) OpenTelemetry::Context.with_current(producer_context) do Freddy.tracer.in_span(name, attributes: span_attributes, kind: kind, &block) end end |
#reply_to ⇒ Object
23 24 25 |
# File 'lib/freddy/delivery.rb', line 23 def reply_to .reply_to end |
#type ⇒ Object
19 20 21 |
# File 'lib/freddy/delivery.rb', line 19 def type .type end |