33module Temporal
44 module Metadata
55 class Activity < Base
6- attr_reader :namespace , :id , :name , :task_token , :attempt , :workflow_run_id , :workflow_id , :workflow_name , :headers , :heartbeat_details
6+ attr_reader :namespace , :id , :name , :task_token , :attempt , :workflow_run_id , :workflow_id , :workflow_name , :headers , :heartbeat_details , :scheduled_at , :current_attempt_scheduled_at
77
8- def initialize ( namespace :, id :, name :, task_token :, attempt :, workflow_run_id :, workflow_id :, workflow_name :, headers : { } , heartbeat_details :)
8+ def initialize ( namespace :, id :, name :, task_token :, attempt :, workflow_run_id :, workflow_id :, workflow_name :, headers : { } , heartbeat_details :, scheduled_at : , current_attempt_scheduled_at : )
99 @namespace = namespace
1010 @id = id
1111 @name = name
@@ -16,6 +16,8 @@ def initialize(namespace:, id:, name:, task_token:, attempt:, workflow_run_id:,
1616 @workflow_name = workflow_name
1717 @headers = headers
1818 @heartbeat_details = heartbeat_details
19+ @scheduled_at = scheduled_at
20+ @current_attempt_scheduled_at = current_attempt_scheduled_at
1921
2022 freeze
2123 end
@@ -32,7 +34,9 @@ def to_h
3234 'workflow_run_id' => workflow_run_id ,
3335 'activity_id' => id ,
3436 'activity_name' => name ,
35- 'attempt' => attempt
37+ 'attempt' => attempt ,
38+ 'scheduled_at' => scheduled_at . to_s ,
39+ 'current_attempt_scheduled_at' => current_attempt_scheduled_at . to_s ,
3640 }
3741 end
3842 end
0 commit comments