Class: Temporalio::Client::ActivityExecution::Description
- Inherits:
-
ActivityExecution
- Object
- ActivityExecution
- Temporalio::Client::ActivityExecution::Description
- Defined in:
- lib/temporalio/client/activity_execution.rb
Overview
Rich description of a standalone activity execution; returned by Temporalio::Client::ActivityHandle#describe.
Instance Attribute Summary collapse
-
#raw_description ⇒ Api::WorkflowService::V1::DescribeActivityExecutionResponse
readonly
Underlying protobuf response.
Instance Method Summary collapse
-
#attempt ⇒ Integer
Current attempt number.
-
#canceled_reason ⇒ String?
Reason given when cancellation was requested.
-
#current_retry_interval ⇒ Float?
Time from last attempt failure to next retry, in seconds.
-
#expiration_time ⇒ Time?
Schedule time + schedule-to-close timeout.
-
#has_heartbeat_details? ⇒ Boolean
Whether the activity has recorded any heartbeat details.
-
#heartbeat_details(hints: nil) ⇒ Array<Object>
Deserialized last-heartbeat details.
-
#heartbeat_timeout ⇒ Float?
Heartbeat timeout in seconds.
-
#last_attempt_complete_time ⇒ Time?
Time when the last attempt completed.
-
#last_deployment_version ⇒ WorkerDeploymentVersion?
Worker deployment version this activity was last dispatched to.
-
#last_failure ⇒ Error::Failure?
Failure of the last failed attempt if any.
-
#last_heartbeat_time ⇒ Time?
Time the last heartbeat was recorded.
-
#last_started_time ⇒ Time?
Time the last attempt started.
-
#last_worker_identity ⇒ String?
Identity of the worker that last picked up this activity.
-
#next_attempt_schedule_time ⇒ Time?
Time when the next attempt will be scheduled.
-
#priority ⇒ Priority
Priority of this activity.
-
#retry_policy ⇒ RetryPolicy
Retry policy in effect for this activity.
-
#run_state ⇒ PendingActivityState?
More detailed breakdown of the running state when the activity's status is RUNNING; nil otherwise.
-
#schedule_to_close_timeout ⇒ Float?
Schedule-to-close timeout in seconds.
-
#schedule_to_start_timeout ⇒ Float?
Schedule-to-start timeout in seconds.
-
#start_to_close_timeout ⇒ Float?
Start-to-close timeout in seconds.
-
#static_details ⇒ String?
Static user-metadata details on the activity.
-
#static_summary ⇒ String?
Static user-metadata summary on the activity.
Instance Attribute Details
#raw_description ⇒ Api::WorkflowService::V1::DescribeActivityExecutionResponse (readonly)
Returns Underlying protobuf response.
75 76 77 |
# File 'lib/temporalio/client/activity_execution.rb', line 75 def raw_description @raw_description end |
Instance Method Details
#attempt ⇒ Integer
Returns Current attempt number. Attempts start at 1 and increment on each retry.
140 141 142 |
# File 'lib/temporalio/client/activity_execution.rb', line 140 def attempt @raw_info.attempt end |
#canceled_reason ⇒ String?
Returns Reason given when cancellation was requested.
193 194 195 |
# File 'lib/temporalio/client/activity_execution.rb', line 193 def canceled_reason Internal::ProtoUtils.string_or(@raw_info.canceled_reason, nil) end |
#current_retry_interval ⇒ Float?
Returns Time from last attempt failure to next retry, in seconds.
162 163 164 |
# File 'lib/temporalio/client/activity_execution.rb', line 162 def current_retry_interval Internal::ProtoUtils.duration_to_seconds(@raw_info.current_retry_interval) end |
#expiration_time ⇒ Time?
Returns Schedule time + schedule-to-close timeout.
152 153 154 |
# File 'lib/temporalio/client/activity_execution.rb', line 152 def expiration_time Internal::ProtoUtils.(@raw_info.expiration_time) end |
#has_heartbeat_details? ⇒ Boolean
Returns Whether the activity has recorded any heartbeat details.
112 113 114 |
# File 'lib/temporalio/client/activity_execution.rb', line 112 def has_heartbeat_details? # rubocop:disable Naming/PredicatePrefix !@raw_info.heartbeat_details&.payloads.nil? && !@raw_info.heartbeat_details.payloads.empty? end |
#heartbeat_details(hints: nil) ⇒ Array<Object>
Deserialized last-heartbeat details. Empty when no heartbeat has been recorded.
120 121 122 |
# File 'lib/temporalio/client/activity_execution.rb', line 120 def heartbeat_details(hints: nil) @data_converter.from_payloads(@raw_info.heartbeat_details, hints:) end |
#heartbeat_timeout ⇒ Float?
Returns Heartbeat timeout in seconds.
107 108 109 |
# File 'lib/temporalio/client/activity_execution.rb', line 107 def heartbeat_timeout Internal::ProtoUtils.duration_to_seconds(@raw_info.heartbeat_timeout) end |
#last_attempt_complete_time ⇒ Time?
Returns Time when the last attempt completed.
167 168 169 |
# File 'lib/temporalio/client/activity_execution.rb', line 167 def last_attempt_complete_time Internal::ProtoUtils.(@raw_info.last_attempt_complete_time) end |
#last_deployment_version ⇒ WorkerDeploymentVersion?
Returns Worker deployment version this activity was last dispatched to.
177 178 179 180 181 182 183 184 185 |
# File 'lib/temporalio/client/activity_execution.rb', line 177 def last_deployment_version raw = @raw_info.last_deployment_version return nil unless raw WorkerDeploymentVersion.new( deployment_name: raw.deployment_name, build_id: raw.build_id ) end |
#last_failure ⇒ Error::Failure?
Returns Failure of the last failed attempt if any.
145 146 147 148 149 |
# File 'lib/temporalio/client/activity_execution.rb', line 145 def last_failure return nil unless @raw_info.last_failure @data_converter.from_failure(@raw_info.last_failure) end |
#last_heartbeat_time ⇒ Time?
Returns Time the last heartbeat was recorded.
130 131 132 |
# File 'lib/temporalio/client/activity_execution.rb', line 130 def last_heartbeat_time Internal::ProtoUtils.(@raw_info.last_heartbeat_time) end |
#last_started_time ⇒ Time?
Returns Time the last attempt started.
135 136 137 |
# File 'lib/temporalio/client/activity_execution.rb', line 135 def last_started_time Internal::ProtoUtils.(@raw_info.last_started_time) end |
#last_worker_identity ⇒ String?
Returns Identity of the worker that last picked up this activity.
157 158 159 |
# File 'lib/temporalio/client/activity_execution.rb', line 157 def last_worker_identity Internal::ProtoUtils.string_or(@raw_info.last_worker_identity, nil) end |
#next_attempt_schedule_time ⇒ Time?
Returns Time when the next attempt will be scheduled.
172 173 174 |
# File 'lib/temporalio/client/activity_execution.rb', line 172 def next_attempt_schedule_time Internal::ProtoUtils.(@raw_info.next_attempt_schedule_time) end |
#priority ⇒ Priority
Returns Priority of this activity.
188 189 190 |
# File 'lib/temporalio/client/activity_execution.rb', line 188 def priority Priority._from_proto(@raw_info.priority) end |
#retry_policy ⇒ RetryPolicy
Returns Retry policy in effect for this activity.
125 126 127 |
# File 'lib/temporalio/client/activity_execution.rb', line 125 def retry_policy RetryPolicy._from_proto(@raw_info.retry_policy) end |
#run_state ⇒ PendingActivityState?
Returns More detailed breakdown of the running state when the activity's status is RUNNING; nil otherwise.
86 87 88 89 |
# File 'lib/temporalio/client/activity_execution.rb', line 86 def run_state Internal::ProtoUtils.enum_to_int(Api::Enums::V1::PendingActivityState, @raw_info.run_state, zero_means_nil: true) end |
#schedule_to_close_timeout ⇒ Float?
Returns Schedule-to-close timeout in seconds.
92 93 94 |
# File 'lib/temporalio/client/activity_execution.rb', line 92 def schedule_to_close_timeout Internal::ProtoUtils.duration_to_seconds(@raw_info.schedule_to_close_timeout) end |
#schedule_to_start_timeout ⇒ Float?
Returns Schedule-to-start timeout in seconds.
97 98 99 |
# File 'lib/temporalio/client/activity_execution.rb', line 97 def schedule_to_start_timeout Internal::ProtoUtils.duration_to_seconds(@raw_info.schedule_to_start_timeout) end |
#start_to_close_timeout ⇒ Float?
Returns Start-to-close timeout in seconds.
102 103 104 |
# File 'lib/temporalio/client/activity_execution.rb', line 102 def start_to_close_timeout Internal::ProtoUtils.duration_to_seconds(@raw_info.start_to_close_timeout) end |
#static_details ⇒ String?
Returns Static user-metadata details on the activity. May be in markdown format.
203 204 205 |
# File 'lib/temporalio/client/activity_execution.rb', line 203 def static_details .last end |
#static_summary ⇒ String?
Returns Static user-metadata summary on the activity.
198 199 200 |
# File 'lib/temporalio/client/activity_execution.rb', line 198 def static_summary .first end |