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