Class: Temporalio::Client::ActivityExecution::Description
- Inherits:
-
Temporalio::Client::ActivityExecution
- Object
- Temporalio::Client::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.
WARNING: Standalone Activities are experimental.
Instance Attribute Summary collapse
-
#raw_description ⇒ Api::WorkflowService::V1::DescribeActivityExecutionResponse
readonly
Underlying protobuf response.
Attributes inherited from Temporalio::Client::ActivityExecution
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.
Methods inherited from Temporalio::Client::ActivityExecution
#activity_id, #activity_run_id, #activity_type, #close_time, #execution_duration, #schedule_time, #search_attributes, #status, #task_queue
Instance Attribute Details
#raw_description ⇒ Api::WorkflowService::V1::DescribeActivityExecutionResponse (readonly)
Returns Underlying protobuf response.
79 80 81 |
# File 'lib/temporalio/client/activity_execution.rb', line 79 def raw_description @raw_description end |
Instance Method Details
#attempt ⇒ Integer
Returns Current attempt number. Attempts start at 1 and increment on each retry.
144 145 146 |
# File 'lib/temporalio/client/activity_execution.rb', line 144 def attempt @raw_info.attempt end |
#canceled_reason ⇒ String?
Returns Reason given when cancellation was requested.
197 198 199 |
# File 'lib/temporalio/client/activity_execution.rb', line 197 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.
166 167 168 |
# File 'lib/temporalio/client/activity_execution.rb', line 166 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.
156 157 158 |
# File 'lib/temporalio/client/activity_execution.rb', line 156 def expiration_time Internal::ProtoUtils.(@raw_info.expiration_time) end |
#has_heartbeat_details? ⇒ Boolean
Returns Whether the activity has recorded any heartbeat details.
116 117 118 |
# File 'lib/temporalio/client/activity_execution.rb', line 116 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.
124 125 126 |
# File 'lib/temporalio/client/activity_execution.rb', line 124 def heartbeat_details(hints: nil) @data_converter.from_payloads(@raw_info.heartbeat_details, hints:) end |
#heartbeat_timeout ⇒ Float?
Returns Heartbeat timeout in seconds.
111 112 113 |
# File 'lib/temporalio/client/activity_execution.rb', line 111 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.
171 172 173 |
# File 'lib/temporalio/client/activity_execution.rb', line 171 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.
181 182 183 184 185 186 187 188 189 |
# File 'lib/temporalio/client/activity_execution.rb', line 181 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.
149 150 151 152 153 |
# File 'lib/temporalio/client/activity_execution.rb', line 149 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.
134 135 136 |
# File 'lib/temporalio/client/activity_execution.rb', line 134 def last_heartbeat_time Internal::ProtoUtils.(@raw_info.last_heartbeat_time) end |
#last_started_time ⇒ Time?
Returns Time the last attempt started.
139 140 141 |
# File 'lib/temporalio/client/activity_execution.rb', line 139 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.
161 162 163 |
# File 'lib/temporalio/client/activity_execution.rb', line 161 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.
176 177 178 |
# File 'lib/temporalio/client/activity_execution.rb', line 176 def next_attempt_schedule_time Internal::ProtoUtils.(@raw_info.next_attempt_schedule_time) end |
#priority ⇒ Priority
Returns Priority of this activity.
192 193 194 |
# File 'lib/temporalio/client/activity_execution.rb', line 192 def priority Priority._from_proto(@raw_info.priority) end |
#retry_policy ⇒ RetryPolicy
Returns Retry policy in effect for this activity.
129 130 131 |
# File 'lib/temporalio/client/activity_execution.rb', line 129 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.
90 91 92 93 |
# File 'lib/temporalio/client/activity_execution.rb', line 90 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.
96 97 98 |
# File 'lib/temporalio/client/activity_execution.rb', line 96 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.
101 102 103 |
# File 'lib/temporalio/client/activity_execution.rb', line 101 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.
106 107 108 |
# File 'lib/temporalio/client/activity_execution.rb', line 106 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.
207 208 209 |
# File 'lib/temporalio/client/activity_execution.rb', line 207 def static_details .last end |
#static_summary ⇒ String?
Returns Static user-metadata summary on the activity.
202 203 204 |
# File 'lib/temporalio/client/activity_execution.rb', line 202 def static_summary .first end |