Class: Temporalio::Client::ActivityExecution

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/client/activity_execution.rb

Overview

Info for a standalone activity execution. Returned by list_activities; extended by Description for describe results.

Defined Under Namespace

Classes: Description

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raw_infoApi::Activity::V1::ActivityExecutionListInfo, Api::Activity::V1::ActivityExecutionInfo (readonly)

Returns Underlying protobuf info.

Returns:

  • Underlying protobuf info.



19
20
21
# File 'lib/temporalio/client/activity_execution.rb', line 19

def raw_info
  @raw_info
end

Instance Method Details

#activity_idString

Returns ID for the activity.

Returns:

  • ID for the activity.



28
29
30
# File 'lib/temporalio/client/activity_execution.rb', line 28

def activity_id
  @raw_info.activity_id
end

#activity_run_idString

Returns Run ID for this activity execution attempt.

Returns:

  • Run ID for this activity execution attempt.



33
34
35
# File 'lib/temporalio/client/activity_execution.rb', line 33

def activity_run_id
  Internal::ProtoUtils.string_or(@raw_info.run_id, nil)
end

#activity_typeString

Returns Type name of the activity.

Returns:

  • Type name of the activity.



38
39
40
# File 'lib/temporalio/client/activity_execution.rb', line 38

def activity_type
  @raw_info.activity_type&.name
end

#close_timeTime?

Returns When the activity reached a terminal state.

Returns:

  • When the activity reached a terminal state.



54
55
56
# File 'lib/temporalio/client/activity_execution.rb', line 54

def close_time
  Internal::ProtoUtils.timestamp_to_time(@raw_info.close_time)
end

#execution_durationFloat?

Returns How long this activity has been running across all attempts, in seconds.

Returns:

  • How long this activity has been running across all attempts, in seconds.



74
75
76
# File 'lib/temporalio/client/activity_execution.rb', line 74

def execution_duration
  Internal::ProtoUtils.duration_to_seconds(@raw_info.execution_duration)
end

#execution_timeTime?

Returns When the first activity task was made available for dispatch. Equals schedule_time + start_delay; equal to schedule_time when no start delay is set.

Returns:

  • When the first activity task was made available for dispatch. Equals schedule_time + start_delay; equal to schedule_time when no start delay is set.



49
50
51
# File 'lib/temporalio/client/activity_execution.rb', line 49

def execution_time
  Internal::ProtoUtils.timestamp_to_time(@raw_info.execution_time)
end

#schedule_timeTime?

Returns When the activity was scheduled.

Returns:

  • When the activity was scheduled.



43
44
45
# File 'lib/temporalio/client/activity_execution.rb', line 43

def schedule_time
  Internal::ProtoUtils.timestamp_to_time(@raw_info.schedule_time)
end

#search_attributesSearchAttributes?

Returns Search attributes attached to this activity if any.

Returns:

  • Search attributes attached to this activity if any.



64
65
66
# File 'lib/temporalio/client/activity_execution.rb', line 64

def search_attributes
  @search_attributes.get
end

#statusActivityExecutionStatus

Returns Overall status for the activity.

Returns:

  • Overall status for the activity.



59
60
61
# File 'lib/temporalio/client/activity_execution.rb', line 59

def status
  Internal::ProtoUtils.enum_to_int(Api::Enums::V1::ActivityExecutionStatus, @raw_info.status)
end

#task_queueString

Returns Task queue for the activity.

Returns:

  • Task queue for the activity.



69
70
71
# File 'lib/temporalio/client/activity_execution.rb', line 69

def task_queue
  @raw_info.task_queue
end