File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -74,16 +74,29 @@ def __init__(self) -> None:
74
74
self ._cancelled = False
75
75
self ._worker_shutdown = False
76
76
self ._activities : Set [_Activity ] = set ()
77
- self .cancellation_details = None
77
+ self .cancellation_details : Optional [
78
+ temporalio .activity .ActivityCancellationDetails
79
+ ] = None
78
80
79
- def cancel (self ) -> None :
81
+ def cancel (
82
+ self ,
83
+ cancellation_details : Optional [
84
+ temporalio .activity .ActivityCancellationDetails
85
+ ] = None ,
86
+ ) -> None :
80
87
"""Cancel the activity.
81
88
89
+ Args:
90
+ cancellation_details: Optional details about the cancellation. When provided, these
91
+ will be accessible through temporalio.activity.cancellation_details()
92
+ in the activity after cancellation.
93
+
82
94
This only has an effect on the first call.
83
95
"""
84
96
if self ._cancelled :
85
97
return
86
98
self ._cancelled = True
99
+ self .cancellation_details = cancellation_details
87
100
for act in self ._activities :
88
101
act .cancel ()
89
102
You can’t perform that action at this time.
0 commit comments