@@ -25,19 +25,21 @@ type (
2525 //
2626 // Exposed as: [go.temporal.io/sdk/activity.Info]
2727 ActivityInfo struct {
28- TaskToken []byte
29- WorkflowType * WorkflowType
30- WorkflowNamespace string
31- WorkflowExecution WorkflowExecution
32- ActivityID string
33- ActivityType ActivityType
34- TaskQueue string
35- HeartbeatTimeout time.Duration // Maximum time between heartbeats. 0 means no heartbeat needed.
36- ScheduledTime time.Time // Time of activity scheduled by a workflow
37- StartedTime time.Time // Time of activity start
38- Deadline time.Time // Time of activity timeout
39- Attempt int32 // Attempt starts from 1, and increased by 1 for every retry if retry policy is specified.
40- IsLocalActivity bool // true if it is a local activity
28+ TaskToken []byte
29+ WorkflowType * WorkflowType
30+ WorkflowNamespace string
31+ WorkflowExecution WorkflowExecution
32+ ActivityID string
33+ ActivityType ActivityType
34+ TaskQueue string
35+ HeartbeatTimeout time.Duration // Maximum time between heartbeats. 0 means no heartbeat needed.
36+ ScheduleToCloseTimeout time.Duration // Schedule to close timeout set by the activity options.
37+ StartToCloseTimeout time.Duration // Start to close timeout set by the activity options.
38+ ScheduledTime time.Time // Time of activity scheduled by a workflow
39+ StartedTime time.Time // Time of activity start
40+ Deadline time.Time // Time of activity timeout
41+ Attempt int32 // Attempt starts from 1, and increased by 1 for every retry if retry policy is specified.
42+ IsLocalActivity bool // true if it is a local activity
4143 // Priority settings that control relative ordering of task processing when activity tasks are backed up in a queue.
4244 // If no priority is set, the default value is the zero value.
4345 //
@@ -318,17 +320,19 @@ func WithActivityTask(
318320 workflowExecution : WorkflowExecution {
319321 RunID : task .WorkflowExecution .RunId ,
320322 ID : task .WorkflowExecution .WorkflowId },
321- logger : logger ,
322- metricsHandler : metricsHandler ,
323- deadline : deadline ,
324- heartbeatTimeout : heartbeatTimeout ,
325- scheduledTime : scheduled ,
326- startedTime : started ,
327- taskQueue : taskQueue ,
328- dataConverter : dataConverter ,
329- attempt : task .GetAttempt (),
330- priority : task .GetPriority (),
331- heartbeatDetails : task .HeartbeatDetails ,
323+ logger : logger ,
324+ metricsHandler : metricsHandler ,
325+ deadline : deadline ,
326+ heartbeatTimeout : heartbeatTimeout ,
327+ scheduleToCloseTimeout : scheduleToCloseTimeout ,
328+ startToCloseTimeout : startToCloseTimeout ,
329+ scheduledTime : scheduled ,
330+ startedTime : started ,
331+ taskQueue : taskQueue ,
332+ dataConverter : dataConverter ,
333+ attempt : task .GetAttempt (),
334+ priority : task .GetPriority (),
335+ heartbeatDetails : task .HeartbeatDetails ,
332336 workflowType : & WorkflowType {
333337 Name : task .WorkflowType .GetName (),
334338 },
@@ -380,22 +384,24 @@ func WithLocalActivityTask(
380384 deadline = task .expireTime
381385 }
382386 return newActivityContext (ctx , interceptors , & activityEnvironment {
383- workflowType : & workflowTypeLocal ,
384- workflowNamespace : task .params .WorkflowInfo .Namespace ,
385- taskQueue : task .params .WorkflowInfo .TaskQueueName ,
386- activityType : ActivityType {Name : activityType },
387- activityID : fmt .Sprintf ("%v" , task .activityID ),
388- workflowExecution : task .params .WorkflowInfo .WorkflowExecution ,
389- logger : logger ,
390- metricsHandler : metricsHandler ,
391- isLocalActivity : true ,
392- deadline : deadline ,
393- scheduledTime : task .scheduledTime ,
394- startedTime : startedTime ,
395- dataConverter : dataConverter ,
396- attempt : task .attempt ,
397- client : client ,
398- workerStopChannel : workerStopChannel ,
387+ workflowType : & workflowTypeLocal ,
388+ workflowNamespace : task .params .WorkflowInfo .Namespace ,
389+ taskQueue : task .params .WorkflowInfo .TaskQueueName ,
390+ activityType : ActivityType {Name : activityType },
391+ activityID : fmt .Sprintf ("%v" , task .activityID ),
392+ workflowExecution : task .params .WorkflowInfo .WorkflowExecution ,
393+ logger : logger ,
394+ metricsHandler : metricsHandler ,
395+ scheduleToCloseTimeout : scheduleToCloseTimeout ,
396+ startToCloseTimeout : startToCloseTimeout ,
397+ isLocalActivity : true ,
398+ deadline : deadline ,
399+ scheduledTime : task .scheduledTime ,
400+ startedTime : startedTime ,
401+ dataConverter : dataConverter ,
402+ attempt : task .attempt ,
403+ client : client ,
404+ workerStopChannel : workerStopChannel ,
399405 })
400406}
401407
0 commit comments