Module: Temporal::Workflow::ConvenienceMethods

Included in:
Temporal::Workflow
Defined in:
lib/temporal/workflow/convenience_methods.rb

Instance Method Summary collapse

Instance Method Details

#execute(*input, **args) ⇒ Object



19
20
21
22
23
24
# File 'lib/temporal/workflow/convenience_methods.rb', line 19

def execute(*input, **args)
  context = Temporal::ThreadLocalContext.get
  raise 'Called Workflow#execute outside of a Workflow context' unless context

  context.execute_workflow(self, *input, **args)
end

#execute!(*input, **args) ⇒ Object



26
27
28
29
30
31
# File 'lib/temporal/workflow/convenience_methods.rb', line 26

def execute!(*input, **args)
  context = Temporal::ThreadLocalContext.get
  raise 'Called Workflow#execute! outside of a Workflow context' unless context

  context.execute_workflow!(self, *input, **args)
end