Class: Temporal::Activity

Inherits:
Object
  • Object
show all
Extended by:
WorkflowConvenienceMethods, Concerns::Executable
Defined in:
lib/temporal/activity.rb,
lib/temporal/activity/poller.rb,
lib/temporal/activity/context.rb,
lib/temporal/activity/async_token.rb,
lib/temporal/activity/task_processor.rb,
lib/temporal/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

headers, namespace, retry_policy, task_list, task_queue, timeouts

Constructor Details

#initialize(context) ⇒ Activity

Returns a new instance of Activity.



15
16
17
# File 'lib/temporal/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/temporal/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/temporal/activity.rb', line 19

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