Module: Julewire::Core::Propagation
- Defined in:
- lib/julewire/core/propagation.rb,
lib/julewire/core/propagation/carrier.rb
Defined Under Namespace
Modules: Carrier
Class Method Summary collapse
Class Method Details
.capture ⇒ Object
11 12 13 |
# File 'lib/julewire/core/propagation.rb', line 11 def capture capture_with { Serialization::Serializer.call(it) } end |
.capture_local ⇒ Object
15 16 17 |
# File 'lib/julewire/core/propagation.rb', line 15 def capture_local capture_with { Fields::FieldSet.deep_dup(it) } end |
.restore(envelope, link_executions: false) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/julewire/core/propagation.rb', line 19 def restore(envelope, link_executions: false, &) raise ArgumentError, "block required" unless block_given? sections = FIELD_SECTIONS.to_h { |section| [section, hash_value(envelope, section)] } execution = hash_value(envelope, :execution) ContextStore.current.with_propagation( **sections, execution: execution, link_executions: link_executions, & ) end |