Class: Julewire::Core::Execution::Boundary

Inherits:
Object
  • Object
show all
Defined in:
lib/julewire/core/execution/boundary.rb

Instance Method Summary collapse

Constructor Details

#initialize(emit_summary_record:, summary_finalizer_failure:, emit_non_standard_exception_summaries:, before_call: nil) ⇒ Boundary

Returns a new instance of Boundary.



24
25
26
27
28
29
30
# File 'lib/julewire/core/execution/boundary.rb', line 24

def initialize(emit_summary_record:, summary_finalizer_failure:, emit_non_standard_exception_summaries:,
               before_call: nil)
  @before_call = before_call
  @emit_summary_record = emit_summary_record
  @summary_finalizer_failure = summary_finalizer_failure
  @emit_non_standard_exception_summaries = emit_non_standard_exception_summaries
end

Instance Method Details

#start_execution(type:, **options) ⇒ Object



39
40
41
42
# File 'lib/julewire/core/execution/boundary.rb', line 39

def start_execution(type:, **options)
  before_call!(:start_execution)
  open_context_execution(:start_execution, type: type, options: options)
end

#with_execution(type:, **options) ⇒ Object

Raises:

  • (ArgumentError)


32
33
34
35
36
37
# File 'lib/julewire/core/execution/boundary.rb', line 32

def with_execution(type:, **options, &)
  before_call!(:with_execution)
  raise ArgumentError, "block required" unless block_given?

  open_context_execution(:with_execution, type: type, options: options, &)
end