temporalio 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -0
  3. data/Rakefile +19 -0
  4. data/lib/temporalio/activity/info.rb +0 -3
  5. data/lib/temporalio/client/activity_execution.rb +83 -6
  6. data/lib/temporalio/client/activity_execution_count.rb +0 -4
  7. data/lib/temporalio/client/activity_execution_options.rb +39 -0
  8. data/lib/temporalio/client/activity_execution_status.rb +1 -2
  9. data/lib/temporalio/client/activity_handle.rb +127 -3
  10. data/lib/temporalio/client/activity_id_reference.rb +0 -4
  11. data/lib/temporalio/client/activity_options.rb +113 -0
  12. data/lib/temporalio/client/interceptor.rb +63 -26
  13. data/lib/temporalio/client/pending_activity_state.rb +0 -2
  14. data/lib/temporalio/client.rb +6 -16
  15. data/lib/temporalio/common_enums.rb +0 -4
  16. data/lib/temporalio/error/failure.rb +0 -2
  17. data/lib/temporalio/error.rb +0 -2
  18. data/lib/temporalio/internal/client/implementation.rb +60 -3
  19. data/lib/temporalio/scoped_logger.rb +3 -0
  20. data/lib/temporalio/version.rb +1 -1
  21. data/lib/temporalio/worker/activity_executor/fiber.rb +11 -1
  22. data/rbi/temporalio/client/activity_execution.rbi +28 -1
  23. data/rbi/temporalio/client/activity_execution_options.rbi +58 -0
  24. data/rbi/temporalio/client/activity_execution_status.rbi +1 -0
  25. data/rbi/temporalio/client/activity_handle.rbi +43 -2
  26. data/rbi/temporalio/client/activity_options.rbi +49 -0
  27. data/rbi/temporalio/client/interceptor.rbi +108 -1
  28. data/rbi/temporalio/client.rbi +4 -4
  29. data/sig/temporalio/client/activity_execution.rbs +11 -1
  30. data/sig/temporalio/client/activity_execution_options.rbs +27 -0
  31. data/sig/temporalio/client/activity_execution_status.rbs +1 -0
  32. data/sig/temporalio/client/activity_handle.rbs +23 -1
  33. data/sig/temporalio/client/activity_options.rbs +30 -0
  34. data/sig/temporalio/client/interceptor.rbs +64 -2
  35. data/sig/temporalio/client.rbs +2 -2
  36. data/sig/temporalio/internal/client/implementation.rbs +7 -0
  37. metadata +7 -1
@@ -260,8 +260,6 @@ module Temporalio
260
260
  )
261
261
 
262
262
  # Input for {Outbound.start_activity}.
263
- #
264
- # WARNING: Standalone Activities are experimental.
265
263
  StartActivityInput = Data.define(
266
264
  :activity,
267
265
  :args,
@@ -275,7 +273,7 @@ module Temporalio
275
273
  :id_conflict_policy,
276
274
  :retry_policy,
277
275
  :search_attributes,
278
- :static_summary,
276
+ :summary,
279
277
  :static_details,
280
278
  :headers,
281
279
  :priority,
@@ -286,17 +284,17 @@ module Temporalio
286
284
  )
287
285
 
288
286
  # Input for {Outbound.describe_activity}.
289
- #
290
- # WARNING: Standalone Activities are experimental.
291
287
  DescribeActivityInput = Data.define(
292
288
  :activity_id,
293
289
  :activity_run_id,
290
+ :include_input,
291
+ :include_outcome,
292
+ :include_heartbeat_details,
293
+ :include_last_failure,
294
294
  :rpc_options
295
295
  )
296
296
 
297
297
  # Input for {Outbound.cancel_activity}.
298
- #
299
- # WARNING: Standalone Activities are experimental.
300
298
  CancelActivityInput = Data.define(
301
299
  :activity_id,
302
300
  :activity_run_id,
@@ -305,26 +303,53 @@ module Temporalio
305
303
  )
306
304
 
307
305
  # Input for {Outbound.terminate_activity}.
306
+ TerminateActivityInput = Data.define(
307
+ :activity_id,
308
+ :activity_run_id,
309
+ :reason,
310
+ :rpc_options
311
+ )
312
+
313
+ # Input for {Outbound.pause_activity}.
308
314
  #
309
315
  # WARNING: Standalone Activities are experimental.
310
- TerminateActivityInput = Data.define(
316
+ PauseActivityInput = Data.define(
311
317
  :activity_id,
312
318
  :activity_run_id,
313
319
  :reason,
314
320
  :rpc_options
315
321
  )
316
322
 
317
- # Input for {Outbound.list_activities}.
323
+ # Input for {Outbound.unpause_activity}.
318
324
  #
319
325
  # WARNING: Standalone Activities are experimental.
326
+ UnpauseActivityInput = Data.define(
327
+ :activity_id,
328
+ :activity_run_id,
329
+ :reason,
330
+ :jitter,
331
+ :rpc_options
332
+ )
333
+
334
+ # Input for {Outbound.update_activity_options}.
335
+ #
336
+ # WARNING: Standalone Activities are experimental.
337
+ UpdateActivityOptionsInput = Data.define(
338
+ :activity_id,
339
+ :activity_run_id,
340
+ :activity_options,
341
+ :update_mask,
342
+ :restore_original,
343
+ :rpc_options
344
+ )
345
+
346
+ # Input for {Outbound.list_activities}.
320
347
  ListActivitiesInput = Data.define(
321
348
  :query,
322
349
  :rpc_options
323
350
  )
324
351
 
325
352
  # Input for {Outbound.count_activities}.
326
- #
327
- # WARNING: Standalone Activities are experimental.
328
353
  CountActivitiesInput = Data.define(
329
354
  :query,
330
355
  :rpc_options
@@ -332,8 +357,6 @@ module Temporalio
332
357
 
333
358
  # Input for {Outbound.fetch_activity_outcome}. Used by `ActivityHandle#result` for long-polling
334
359
  # the activity outcome via `PollActivityExecution`.
335
- #
336
- # WARNING: Standalone Activities are experimental.
337
360
  FetchActivityOutcomeInput = Data.define(
338
361
  :activity_id,
339
362
  :activity_run_id,
@@ -551,8 +574,6 @@ module Temporalio
551
574
 
552
575
  # Called for every {Client.start_activity} and {Client.execute_activity} call.
553
576
  #
554
- # WARNING: Standalone Activities are experimental.
555
- #
556
577
  # @param input [StartActivityInput] Input.
557
578
  # @return [ActivityHandle] Activity handle.
558
579
  def start_activity(input)
@@ -561,8 +582,6 @@ module Temporalio
561
582
 
562
583
  # Called for every {ActivityHandle.describe} call.
563
584
  #
564
- # WARNING: Standalone Activities are experimental.
565
- #
566
585
  # @param input [DescribeActivityInput] Input.
567
586
  # @return [ActivityExecution::Description] Activity description.
568
587
  def describe_activity(input)
@@ -571,8 +590,6 @@ module Temporalio
571
590
 
572
591
  # Called for every {ActivityHandle.cancel} call.
573
592
  #
574
- # WARNING: Standalone Activities are experimental.
575
- #
576
593
  # @param input [CancelActivityInput] Input.
577
594
  def cancel_activity(input)
578
595
  next_interceptor.cancel_activity(input)
@@ -580,17 +597,41 @@ module Temporalio
580
597
 
581
598
  # Called for every {ActivityHandle.terminate} call.
582
599
  #
583
- # WARNING: Standalone Activities are experimental.
584
- #
585
600
  # @param input [TerminateActivityInput] Input.
586
601
  def terminate_activity(input)
587
602
  next_interceptor.terminate_activity(input)
588
603
  end
589
604
 
590
- # Called for every {Client.list_activities} call.
605
+ # Called for every {ActivityHandle.pause} call.
606
+ #
607
+ # WARNING: Standalone Activities are experimental.
608
+ #
609
+ # @param input [PauseActivityInput] Input.
610
+ def pause_activity(input)
611
+ next_interceptor.pause_activity(input)
612
+ end
613
+
614
+ # Called for every {ActivityHandle.unpause} call.
615
+ #
616
+ # WARNING: Standalone Activities are experimental.
617
+ #
618
+ # @param input [UnpauseActivityInput] Input.
619
+ def unpause_activity(input)
620
+ next_interceptor.unpause_activity(input)
621
+ end
622
+
623
+ # Called for every {ActivityHandle.update_options} call.
591
624
  #
592
625
  # WARNING: Standalone Activities are experimental.
593
626
  #
627
+ # @param input [UpdateActivityOptionsInput] Input.
628
+ # @return [Api::Activity::V1::ActivityOptions] Activity options after the update.
629
+ def update_activity_options(input)
630
+ next_interceptor.update_activity_options(input)
631
+ end
632
+
633
+ # Called for every {Client.list_activities} call.
634
+ #
594
635
  # @param input [ListActivitiesInput] Input.
595
636
  # @return [Enumerator<ActivityExecution>] Activity executions.
596
637
  def list_activities(input)
@@ -599,8 +640,6 @@ module Temporalio
599
640
 
600
641
  # Called for every {Client.count_activities} call.
601
642
  #
602
- # WARNING: Standalone Activities are experimental.
603
- #
604
643
  # @param input [CountActivitiesInput] Input.
605
644
  # @return [ActivityExecutionCount] Activity count.
606
645
  def count_activities(input)
@@ -609,8 +648,6 @@ module Temporalio
609
648
 
610
649
  # Called by {ActivityHandle.result} to long-poll the activity outcome.
611
650
  #
612
- # WARNING: Standalone Activities are experimental.
613
- #
614
651
  # @param input [FetchActivityOutcomeInput] Input.
615
652
  # @return [Api::Activity::V1::ActivityExecutionOutcome] Activity outcome.
616
653
  def fetch_activity_outcome(input)
@@ -5,8 +5,6 @@ require 'temporalio/api'
5
5
  module Temporalio
6
6
  class Client
7
7
  # More detailed breakdown of a running activity's state.
8
- #
9
- # WARNING: Standalone Activities are experimental.
10
8
  module PendingActivityState
11
9
  SCHEDULED = Api::Enums::V1::PendingActivityState::PENDING_ACTIVITY_STATE_SCHEDULED
12
10
  STARTED = Api::Enums::V1::PendingActivityState::PENDING_ACTIVITY_STATE_STARTED
@@ -485,8 +485,6 @@ module Temporalio
485
485
  # Get a handle for an existing standalone activity. Useful when the activity was started elsewhere
486
486
  # (a different process, or by another client) and you have only its ID.
487
487
  #
488
- # WARNING: Standalone Activities are experimental.
489
- #
490
488
  # @param activity_id [String] ID for the activity.
491
489
  # @param activity_run_id [String, nil] Run ID for the activity execution. If nil, operations target the
492
490
  # latest run of the given activity ID.
@@ -500,8 +498,6 @@ module Temporalio
500
498
 
501
499
  # Start a standalone activity execution and return its handle.
502
500
  #
503
- # WARNING: Standalone Activities are experimental.
504
- #
505
501
  # @param activity [Class<Activity::Definition>, Activity::Definition, Activity::Definition::Info, Symbol, String]
506
502
  # Activity definition, definition class or activity name.
507
503
  # @param args [Array<Object>] Arguments to the activity.
@@ -519,7 +515,7 @@ module Temporalio
519
515
  # is currently running. Defaults to `FAIL` (reject the start attempt).
520
516
  # @param retry_policy [RetryPolicy, nil] Retry policy for the activity.
521
517
  # @param search_attributes [SearchAttributes, nil] Search attributes for the activity.
522
- # @param static_summary [String, nil] Fixed single-line summary for this activity execution.
518
+ # @param summary [String, nil] Fixed single-line summary for this activity execution.
523
519
  # @param static_details [String, nil] Fixed details for this activity execution. May be in markdown format.
524
520
  # @param priority [Priority] Priority for the activity. This is currently experimental.
525
521
  # @param start_delay [Float, nil] Time (in seconds) to wait before dispatching the first activity task. This delay
@@ -545,7 +541,7 @@ module Temporalio
545
541
  id_conflict_policy: ActivityIDConflictPolicy::FAIL,
546
542
  retry_policy: nil,
547
543
  search_attributes: nil,
548
- static_summary: nil,
544
+ summary: nil,
549
545
  static_details: nil,
550
546
  priority: Priority.default,
551
547
  start_delay: nil,
@@ -568,7 +564,7 @@ module Temporalio
568
564
  id_conflict_policy:,
569
565
  retry_policy:,
570
566
  search_attributes:,
571
- static_summary:,
567
+ summary:,
572
568
  static_details:,
573
569
  headers: {},
574
570
  priority:,
@@ -582,8 +578,6 @@ module Temporalio
582
578
  # Start a standalone activity execution and wait for its result. Shortcut for
583
579
  # {start_activity} + {ActivityHandle#result}.
584
580
  #
585
- # WARNING: Standalone Activities are experimental.
586
- #
587
581
  # @param activity [Class<Activity::Definition>, Activity::Definition, Activity::Definition::Info, Symbol, String]
588
582
  # Activity definition, definition class or activity name.
589
583
  # @param args [Array<Object>] Arguments to the activity.
@@ -601,7 +595,7 @@ module Temporalio
601
595
  # is currently running. Defaults to `FAIL` (reject the start attempt).
602
596
  # @param retry_policy [RetryPolicy, nil] Retry policy for the activity.
603
597
  # @param search_attributes [SearchAttributes, nil] Search attributes for the activity.
604
- # @param static_summary [String, nil] Fixed single-line summary for this activity execution.
598
+ # @param summary [String, nil] Fixed single-line summary for this activity execution.
605
599
  # @param static_details [String, nil] Fixed details for this activity execution. May be in markdown format.
606
600
  # @param priority [Priority] Priority for the activity. This is currently experimental.
607
601
  # @param start_delay [Float, nil] Time (in seconds) to wait before dispatching the first activity task. This delay
@@ -628,7 +622,7 @@ module Temporalio
628
622
  id_conflict_policy: ActivityIDConflictPolicy::FAIL,
629
623
  retry_policy: nil,
630
624
  search_attributes: nil,
631
- static_summary: nil,
625
+ summary: nil,
632
626
  static_details: nil,
633
627
  priority: Priority.default,
634
628
  start_delay: nil,
@@ -649,7 +643,7 @@ module Temporalio
649
643
  id_conflict_policy:,
650
644
  retry_policy:,
651
645
  search_attributes:,
652
- static_summary:,
646
+ summary:,
653
647
  static_details:,
654
648
  priority:,
655
649
  start_delay:,
@@ -661,8 +655,6 @@ module Temporalio
661
655
 
662
656
  # List standalone activities matching a visibility query.
663
657
  #
664
- # WARNING: Standalone Activities are experimental.
665
- #
666
658
  # @param query [String] Visibility list filter.
667
659
  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
668
660
  #
@@ -674,8 +666,6 @@ module Temporalio
674
666
 
675
667
  # Count standalone activities matching a visibility query.
676
668
  #
677
- # WARNING: Standalone Activities are experimental.
678
- #
679
669
  # @param query [String] Visibility list filter.
680
670
  # @param rpc_options [RPCOptions, nil] Advanced RPC options.
681
671
  #
@@ -86,8 +86,6 @@ module Temporalio
86
86
 
87
87
  # Controls behavior when an activity with the same ID was previously run and is now closed.
88
88
  #
89
- # WARNING: Standalone Activities are experimental.
90
- #
91
89
  # @see https://docs.temporal.io/activities
92
90
  module ActivityIDReusePolicy
93
91
  # Always allow starting an activity using the same activity ID.
@@ -102,8 +100,6 @@ module Temporalio
102
100
 
103
101
  # Controls behavior when an activity with the same ID is currently running.
104
102
  #
105
- # WARNING: Standalone Activities are experimental.
106
- #
107
103
  # @see https://docs.temporal.io/activities
108
104
  module ActivityIDConflictPolicy
109
105
  # Don't start a new activity; instead fail with already-started error.
@@ -30,8 +30,6 @@ module Temporalio
30
30
  end
31
31
 
32
32
  # Error raised by a client when a standalone activity execution has already started.
33
- #
34
- # WARNING: Standalone Activities are experimental.
35
33
  class ActivityAlreadyStartedError < Failure
36
34
  # @return [String] ID of the already-started activity.
37
35
  attr_reader :activity_id
@@ -42,8 +42,6 @@ module Temporalio
42
42
 
43
43
  # Error returned from {Client::ActivityHandle#result} when the activity did not complete successfully.
44
44
  # The specific activity failure can be accessed via `cause`.
45
- #
46
- # WARNING: Standalone Activities are experimental.
47
45
  class ActivityFailedError < Error
48
46
  # @!visibility private
49
47
  def initialize(message = 'Activity execution failed')
@@ -29,7 +29,7 @@ require 'temporalio/workflow/definition'
29
29
  module Temporalio
30
30
  module Internal
31
31
  module Client
32
- class Implementation < Temporalio::Client::Interceptor::Outbound
32
+ class Implementation < Temporalio::Client::Interceptor::Outbound # rubocop:disable Metrics/ClassLength
33
33
  # Proto routing convention for standalone activity completion: `*_by_id` requests carry
34
34
  # `resource_id = "activity:<activity_id>"`. See the resource_id field comment on
35
35
  # `RecordActivityTaskHeartbeatByIdRequest` (and the analogous Completed/Failed/Canceled
@@ -984,7 +984,7 @@ module Temporalio
984
984
  retry_policy: input.retry_policy&._to_proto,
985
985
  search_attributes: input.search_attributes&._to_proto,
986
986
  user_metadata: ProtoUtils.to_user_metadata(
987
- input.static_summary, input.static_details, @client.data_converter
987
+ input.summary, input.static_details, @client.data_converter
988
988
  ),
989
989
  header: ProtoUtils.headers_to_proto(input.headers, @client.data_converter),
990
990
  priority: input.priority._to_proto,
@@ -1025,7 +1025,11 @@ module Temporalio
1025
1025
  Api::WorkflowService::V1::DescribeActivityExecutionRequest.new(
1026
1026
  namespace: @client.namespace,
1027
1027
  activity_id: input.activity_id,
1028
- run_id: input.activity_run_id || ''
1028
+ run_id: input.activity_run_id || '',
1029
+ include_input: input.include_input,
1030
+ include_outcome: input.include_outcome,
1031
+ include_heartbeat_details: input.include_heartbeat_details,
1032
+ include_last_failure: input.include_last_failure
1029
1033
  ),
1030
1034
  rpc_options: Implementation.with_default_rpc_options(input.rpc_options)
1031
1035
  )
@@ -1062,6 +1066,59 @@ module Temporalio
1062
1066
  nil
1063
1067
  end
1064
1068
 
1069
+ def pause_activity(input)
1070
+ @client.workflow_service.pause_activity_execution(
1071
+ Api::WorkflowService::V1::PauseActivityExecutionRequest.new(
1072
+ namespace: @client.namespace,
1073
+ activity_id: input.activity_id,
1074
+ run_id: input.activity_run_id || '',
1075
+ identity: @client.connection.identity,
1076
+ request_id: SecureRandom.uuid,
1077
+ reason: input.reason || ''
1078
+ ),
1079
+ rpc_options: Implementation.with_default_rpc_options(input.rpc_options)
1080
+ )
1081
+ nil
1082
+ end
1083
+
1084
+ def unpause_activity(input)
1085
+ @client.workflow_service.unpause_activity_execution(
1086
+ Api::WorkflowService::V1::UnpauseActivityExecutionRequest.new(
1087
+ namespace: @client.namespace,
1088
+ activity_id: input.activity_id,
1089
+ run_id: input.activity_run_id || '',
1090
+ identity: @client.connection.identity,
1091
+ request_id: SecureRandom.uuid,
1092
+ reason: input.reason || '',
1093
+ jitter: ProtoUtils.seconds_to_duration(input.jitter)
1094
+ ),
1095
+ rpc_options: Implementation.with_default_rpc_options(input.rpc_options)
1096
+ )
1097
+ nil
1098
+ end
1099
+
1100
+ def update_activity_options(input)
1101
+ # The handle rejects a repeated option, but an interceptor could still add one.
1102
+ paths = input.update_mask&.paths || []
1103
+ dupe = paths.tally.find { |_, count| count > 1 }&.first
1104
+ raise ArgumentError, "More than one update given for option #{dupe}" if dupe
1105
+
1106
+ resp = @client.workflow_service.update_activity_execution_options(
1107
+ Api::WorkflowService::V1::UpdateActivityExecutionOptionsRequest.new(
1108
+ namespace: @client.namespace,
1109
+ activity_id: input.activity_id,
1110
+ run_id: input.activity_run_id || '',
1111
+ identity: @client.connection.identity,
1112
+ request_id: SecureRandom.uuid,
1113
+ activity_options: input.activity_options,
1114
+ update_mask: input.update_mask,
1115
+ restore_original: input.restore_original
1116
+ ),
1117
+ rpc_options: Implementation.with_default_rpc_options(input.rpc_options)
1118
+ )
1119
+ Temporalio::Client::ActivityExecutionOptions._from_proto(resp.activity_options)
1120
+ end
1121
+
1065
1122
  def list_activities(input)
1066
1123
  Enumerator.new do |yielder|
1067
1124
  req = Api::WorkflowService::V1::ListActivityExecutionsRequest.new(
@@ -106,6 +106,9 @@ module Temporalio
106
106
  message_str = message.is_a?(String) ? message : message.inspect
107
107
  "#{message_str} #{scoped_values}"
108
108
  end
109
+
110
+ # @return [String] The log message.
111
+ alias to_s message
109
112
  end
110
113
  end
111
114
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Temporalio
4
- VERSION = '1.7.0'
4
+ VERSION = '1.9.0'
5
5
  end
@@ -39,8 +39,18 @@ module Temporalio
39
39
  return unless defn.cancel_raise
40
40
 
41
41
  fiber = ::Fiber.current
42
+ scheduler = ::Fiber.scheduler
43
+ scheduler = nil unless scheduler.respond_to?(:fiber_interrupt)
42
44
  context&.cancellation&.add_cancel_callback do
43
- fiber.raise(Error::CanceledError.new('Activity canceled'))
45
+ error = Error::CanceledError.new('Activity canceled')
46
+ # Directly raising from another fiber can strand a `Fiber#transfer`
47
+ # based scheduler's current fiber, so we defer to the scheduler to interrupt.
48
+ # If on the same fiber, we can just raise directly.
49
+ if scheduler.nil? || ::Fiber.current.equal?(fiber)
50
+ fiber.raise(error)
51
+ else
52
+ scheduler.fiber_interrupt(fiber, error)
53
+ end
44
54
  end
45
55
  end
46
56
  end
@@ -33,6 +33,9 @@ class Temporalio::Client::ActivityExecution
33
33
  sig { returns(T.nilable(Time)) }
34
34
  def schedule_time; end
35
35
 
36
+ sig { returns(T.nilable(Time)) }
37
+ def execution_time; end
38
+
36
39
  sig { returns(T.nilable(Time)) }
37
40
  def close_time; end
38
41
 
@@ -76,9 +79,30 @@ class Temporalio::Client::ActivityExecution::Description < ::Temporalio::Client:
76
79
  sig { returns(T.nilable(Float)) }
77
80
  def heartbeat_timeout; end
78
81
 
82
+ sig { returns(T.nilable(Float)) }
83
+ def start_delay; end
84
+
79
85
  sig { returns(T::Boolean) }
80
86
  def has_heartbeat_details?; end
81
87
 
88
+ sig { returns(T::Boolean) }
89
+ def has_last_failure?; end
90
+
91
+ sig { returns(T::Boolean) }
92
+ def has_input?; end
93
+
94
+ sig { params(hints: T.nilable(T::Array[Object])).returns(T::Array[T.nilable(Object)]) }
95
+ def input(hints: T.unsafe(nil)); end
96
+
97
+ sig { returns(T::Boolean) }
98
+ def has_result?; end
99
+
100
+ sig { params(result_hint: T.nilable(Object)).returns(T.nilable(Object)) }
101
+ def result(result_hint: T.unsafe(nil)); end
102
+
103
+ sig { returns(T.nilable(Temporalio::Error::Failure)) }
104
+ def failure; end
105
+
82
106
  sig { params(hints: T.nilable(T::Array[Object])).returns(T::Array[T.nilable(Object)]) }
83
107
  def heartbeat_details(hints: T.unsafe(nil)); end
84
108
 
@@ -94,6 +118,9 @@ class Temporalio::Client::ActivityExecution::Description < ::Temporalio::Client:
94
118
  sig { returns(Integer) }
95
119
  def attempt; end
96
120
 
121
+ sig { returns(Integer) }
122
+ def total_heartbeat_count; end
123
+
97
124
  sig { returns(T.nilable(Temporalio::Error::Failure)) }
98
125
  def last_failure; end
99
126
 
@@ -122,7 +149,7 @@ class Temporalio::Client::ActivityExecution::Description < ::Temporalio::Client:
122
149
  def canceled_reason; end
123
150
 
124
151
  sig { returns(T.nilable(String)) }
125
- def static_summary; end
152
+ def summary; end
126
153
 
127
154
  sig { returns(T.nilable(String)) }
128
155
  def static_details; end
@@ -0,0 +1,58 @@
1
+ # typed: true
2
+
3
+ class Temporalio::Client::ActivityExecutionOptions
4
+ class << self
5
+ sig do
6
+ params(options: Temporalio::Api::Activity::V1::ActivityOptions)
7
+ .returns(Temporalio::Client::ActivityExecutionOptions)
8
+ end
9
+ def _from_proto(options); end
10
+ end
11
+
12
+ sig do
13
+ params(
14
+ task_queue: T.nilable(String),
15
+ schedule_to_close_timeout: T.nilable(Float),
16
+ schedule_to_start_timeout: T.nilable(Float),
17
+ start_to_close_timeout: T.nilable(Float),
18
+ heartbeat_timeout: T.nilable(Float),
19
+ retry_policy: T.nilable(Temporalio::RetryPolicy),
20
+ priority: Temporalio::Priority,
21
+ start_delay: T.nilable(Float)
22
+ ).void
23
+ end
24
+ def initialize(
25
+ task_queue:,
26
+ schedule_to_close_timeout:,
27
+ schedule_to_start_timeout:,
28
+ start_to_close_timeout:,
29
+ heartbeat_timeout:,
30
+ retry_policy:,
31
+ priority:,
32
+ start_delay:
33
+ ); end
34
+
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :task_queue
37
+
38
+ sig { returns(T.nilable(Float)) }
39
+ attr_reader :schedule_to_close_timeout
40
+
41
+ sig { returns(T.nilable(Float)) }
42
+ attr_reader :schedule_to_start_timeout
43
+
44
+ sig { returns(T.nilable(Float)) }
45
+ attr_reader :start_to_close_timeout
46
+
47
+ sig { returns(T.nilable(Float)) }
48
+ attr_reader :heartbeat_timeout
49
+
50
+ sig { returns(T.nilable(Temporalio::RetryPolicy)) }
51
+ attr_reader :retry_policy
52
+
53
+ sig { returns(Temporalio::Priority) }
54
+ attr_reader :priority
55
+
56
+ sig { returns(T.nilable(Float)) }
57
+ attr_reader :start_delay
58
+ end
@@ -8,4 +8,5 @@ module Temporalio::Client::ActivityExecutionStatus
8
8
  CANCELED = T.let(T.unsafe(nil), Integer)
9
9
  TERMINATED = T.let(T.unsafe(nil), Integer)
10
10
  TIMED_OUT = T.let(T.unsafe(nil), Integer)
11
+ PAUSED = T.let(T.unsafe(nil), Integer)
11
12
  end
@@ -1,6 +1,8 @@
1
1
  # typed: true
2
2
 
3
3
  class Temporalio::Client::ActivityHandle
4
+ UPDATABLE_OPTION_PATHS = T.let(T.unsafe(nil), T::Hash[Symbol, String])
5
+
4
6
  sig do
5
7
  params(
6
8
  client: Temporalio::Client,
@@ -28,8 +30,22 @@ class Temporalio::Client::ActivityHandle
28
30
  end
29
31
  def result(result_hint: T.unsafe(nil), rpc_options: T.unsafe(nil)); end
30
32
 
31
- sig { params(rpc_options: T.nilable(Temporalio::Client::RPCOptions)).returns(Temporalio::Client::ActivityExecution::Description) }
32
- def describe(rpc_options: T.unsafe(nil)); end
33
+ sig do
34
+ params(
35
+ include_input: T::Boolean,
36
+ include_outcome: T::Boolean,
37
+ include_heartbeat_details: T::Boolean,
38
+ include_last_failure: T::Boolean,
39
+ rpc_options: T.nilable(Temporalio::Client::RPCOptions)
40
+ ).returns(Temporalio::Client::ActivityExecution::Description)
41
+ end
42
+ def describe(
43
+ include_input: T.unsafe(nil),
44
+ include_outcome: T.unsafe(nil),
45
+ include_heartbeat_details: T.unsafe(nil),
46
+ include_last_failure: T.unsafe(nil),
47
+ rpc_options: T.unsafe(nil)
48
+ ); end
33
49
 
34
50
  sig { params(reason: T.nilable(String), rpc_options: T.nilable(Temporalio::Client::RPCOptions)).void }
35
51
  def cancel(reason = T.unsafe(nil), rpc_options: T.unsafe(nil)); end
@@ -37,6 +53,31 @@ class Temporalio::Client::ActivityHandle
37
53
  sig { params(reason: T.nilable(String), rpc_options: T.nilable(Temporalio::Client::RPCOptions)).void }
38
54
  def terminate(reason = T.unsafe(nil), rpc_options: T.unsafe(nil)); end
39
55
 
56
+ sig { params(reason: T.nilable(String), rpc_options: T.nilable(Temporalio::Client::RPCOptions)).void }
57
+ def pause(reason = T.unsafe(nil), rpc_options: T.unsafe(nil)); end
58
+
59
+ sig do
60
+ params(
61
+ reason: T.nilable(String),
62
+ jitter: T.nilable(Float),
63
+ rpc_options: T.nilable(Temporalio::Client::RPCOptions)
64
+ ).void
65
+ end
66
+ def unpause(reason: T.unsafe(nil), jitter: T.unsafe(nil), rpc_options: T.unsafe(nil)); end
67
+
68
+ sig do
69
+ params(
70
+ updates: Temporalio::Client::ActivityOptions::Update,
71
+ restore_original: T::Boolean,
72
+ rpc_options: T.nilable(Temporalio::Client::RPCOptions)
73
+ ).returns(Temporalio::Client::ActivityExecutionOptions)
74
+ end
75
+ def update_options(
76
+ *updates,
77
+ restore_original: T.unsafe(nil),
78
+ rpc_options: T.unsafe(nil)
79
+ ); end
80
+
40
81
  private
41
82
 
42
83
  sig do