Class: Cadence::Activity

Inherits:
Object
  • Object
show all
Extended by:
WorkflowConvenienceMethods, Concerns::Executable
Defined in:
lib/cadence/activity.rb,
lib/cadence/activity/poller.rb,
lib/cadence/activity/context.rb,
lib/cadence/activity/async_token.rb,
lib/cadence/activity/task_processor.rb,
lib/cadence/activity/workflow_convenience_methods.rb

Defined Under Namespace

Modules: WorkflowConvenienceMethods Classes: AsyncToken, Context, Poller, TaskProcessor

Class Method Summary collapse

Instance Method Summary collapse

Methods included from WorkflowConvenienceMethods

execute!, execute_locally

Methods included from Concerns::Executable

domain, headers, retry_policy, task_list, timeouts

Constructor Details

#initialize(context) ⇒ Activity

Returns a new instance of Activity.



15
16
17
# File 'lib/cadence/activity.rb', line 15

def initialize(context)
  @context = context
end

Class Method Details

.execute_in_context(context, input) ⇒ Object



10
11
12
13
# File 'lib/cadence/activity.rb', line 10

def self.execute_in_context(context, input)
  activity = new(context)
  activity.execute(*input)
end

Instance Method Details

#execute(*_args) ⇒ Object

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/cadence/activity.rb', line 19

def execute(*_args)
  raise NotImplementedError, '#execute method must be implemented by a subclass'
end