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.

WARNING: Standalone Activities are experimental.

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.



21
22
23
# File 'lib/temporalio/client/activity_execution.rb', line 21

def raw_info
  @raw_info
end

Instance Method Details

#activity_idString

Returns ID for the activity.

Returns:

  • (String)

    ID for the activity.



30
31
32
# File 'lib/temporalio/client/activity_execution.rb', line 30

def activity_id
  @raw_info.activity_id
end

#activity_run_idString

Returns Run ID for this activity execution attempt.

Returns:

  • (String)

    Run ID for this activity execution attempt.



35
36
37
# File 'lib/temporalio/client/activity_execution.rb', line 35

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

#activity_typeString

Returns Type name of the activity.

Returns:

  • (String)

    Type name of the activity.



40
41
42
# File 'lib/temporalio/client/activity_execution.rb', line 40

def activity_type
  @raw_info.activity_type&.name
end

#close_timeTime?

Returns When the activity reached a terminal state.

Returns:

  • (Time, nil)

    When the activity reached a terminal state.



56
57
58
# File 'lib/temporalio/client/activity_execution.rb', line 56

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:

  • (Float, nil)

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



76
77
78
# File 'lib/temporalio/client/activity_execution.rb', line 76

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:

  • (Time, nil)

    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.



51
52
53
# File 'lib/temporalio/client/activity_execution.rb', line 51

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

#schedule_timeTime?

Returns When the activity was scheduled.

Returns:

  • (Time, nil)

    When the activity was scheduled.



45
46
47
# File 'lib/temporalio/client/activity_execution.rb', line 45

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:

  • (SearchAttributes, nil)

    Search attributes attached to this activity if any.



66
67
68
# File 'lib/temporalio/client/activity_execution.rb', line 66

def search_attributes
  @search_attributes.get
end

#statusActivityExecutionStatus

Returns Overall status for the activity.

Returns:



61
62
63
# File 'lib/temporalio/client/activity_execution.rb', line 61

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

#task_queueString

Returns Task queue for the activity.

Returns:

  • (String)

    Task queue for the activity.



71
72
73
# File 'lib/temporalio/client/activity_execution.rb', line 71

def task_queue
  @raw_info.task_queue
end