File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 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:
7676        self ._activities : Set [_Activity ] =  set ()
7777        self .cancellation_details  =  None 
7878
79-     def  cancel (self ) ->  None :
79+     def  cancel (self ,  cancellation_details :  Optional [ temporalio . activity . ActivityCancellationDetails ]  =   None ) ->  None :
8080        """Cancel the activity. 
8181
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+ 
8287        This only has an effect on the first call. 
8388        """ 
8489        if  self ._cancelled :
8590            return 
8691        self ._cancelled  =  True 
92+         # Set cancellation details if provided 
93+         if  cancellation_details  is  not   None :
94+             self .cancellation_details  =  cancellation_details 
8795        for  act  in  self ._activities :
8896            act .cancel ()
8997
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments