Class: Kiev::SubrequestHelper
- Inherits:
-
Object
- Object
- Kiev::SubrequestHelper
- Defined in:
- lib/kiev/subrequest_helper.rb
Class Method Summary collapse
- .headers(metadata: false) ⇒ Object
- .payload ⇒ Object
- .root_path(synchronous:) ⇒ Object
- .subrequest_path(synchronous:) ⇒ Object
Class Method Details
.headers(metadata: false) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/kiev/subrequest_helper.rb', line 8 def headers(metadata: false) Config.instance.all_http_propagated_fields.map do |key, http_key| field = field_value(key, true) [ ? key : http_key, field.to_s] if field end.compact.to_h end |
.payload ⇒ Object
15 16 17 18 19 20 |
# File 'lib/kiev/subrequest_helper.rb', line 15 def payload Config.instance.all_jobs_propagated_fields.map do |key| field = field_value(key, false) [key.to_s, field] if field end.compact.to_h end |
.root_path(synchronous:) ⇒ Object
22 23 24 |
# File 'lib/kiev/subrequest_helper.rb', line 22 def root_path(synchronous:) encode(0, synchronous) end |
.subrequest_path(synchronous:) ⇒ Object
26 27 28 |
# File 'lib/kiev/subrequest_helper.rb', line 26 def subrequest_path(synchronous:) current_path + encode(counter, synchronous) end |