@@ -5119,25 +5119,29 @@ def _to_proto(self) -> temporalio.bridge.proto.common.VersioningIntent.ValueType
51195119
51205120
51215121class NexusOperationCancellationType (IntEnum ):
5122- """Controls at which point to report back to lang when a nexus operation is
5123- cancelled."""
5122+ """Defines behavior of the parent workflow when CancellationScope that wraps Nexus operation
5123+ is canceled. The result of the cancellation independently of the type is a
5124+ CanceledFailure thrown from the Nexus operation method. If the caller exits without waiting, the
5125+ cancellation request may not be delivered to the handler, regardless of indicated cancellation
5126+ type.
5127+ """
51245128
5125- WAIT_CANCELLATION_COMPLETED = 0
5126- """Wait for operation cancellation completion. Default."""
5129+ WAIT_COMPLETED = 0
5130+ """Wait for operation completion. Operation may or may not complete as cancelled . Default."""
51275131
51285132 ABANDON = 1
5129- """Do not request cancellation of the nexus operation if already scheduled ."""
5133+ """Do not request cancellation of the operation."""
51305134
51315135 TRY_CANCEL = 2
5132- """Initiate a cancellation request for the Nexus operation and immediately report
5133- cancellation to the caller. Note that it doesn't guarantee that cancellation is
5134- delivered to the operation if calling workflow exits before the delivery is done. If
5135- you want to ensure that cancellation is delivered to the operation, use
5136- WAIT_CANCELLATION_REQUESTED."""
5136+ """Initiate a cancellation request and immediately report cancellation to the caller. Note that it
5137+ doesn't guarantee that cancellation is delivered to the operation handler if the caller exits
5138+ before the delivery is done.
5139+ """
51375140
5138- WAIT_CANCELLATION_REQUESTED = 3
5139- """Request cancellation of the operation and wait for confirmation that the request
5140- was received."""
5141+ WAIT_REQUESTED = 3
5142+ """Request cancellation of the operation and wait for confirmation that the request was received.
5143+ Doesn't wait for actual cancellation.
5144+ """
51415145
51425146
51435147class NexusClient (ABC , Generic [ServiceT ]):
@@ -5170,7 +5174,7 @@ async def start_operation(
51705174 * ,
51715175 output_type : Optional [type [OutputT ]] = None ,
51725176 schedule_to_close_timeout : Optional [timedelta ] = None ,
5173- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5177+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
51745178 headers : Optional [Mapping [str , str ]] = None ,
51755179 ) -> NexusOperationHandle [OutputT ]: ...
51765180
@@ -5184,7 +5188,7 @@ async def start_operation(
51845188 * ,
51855189 output_type : Optional [type [OutputT ]] = None ,
51865190 schedule_to_close_timeout : Optional [timedelta ] = None ,
5187- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5191+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
51885192 headers : Optional [Mapping [str , str ]] = None ,
51895193 ) -> NexusOperationHandle [OutputT ]: ...
51905194
@@ -5201,7 +5205,7 @@ async def start_operation(
52015205 * ,
52025206 output_type : Optional [type [OutputT ]] = None ,
52035207 schedule_to_close_timeout : Optional [timedelta ] = None ,
5204- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5208+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
52055209 headers : Optional [Mapping [str , str ]] = None ,
52065210 ) -> NexusOperationHandle [OutputT ]: ...
52075211
@@ -5218,7 +5222,7 @@ async def start_operation(
52185222 * ,
52195223 output_type : Optional [type [OutputT ]] = None ,
52205224 schedule_to_close_timeout : Optional [timedelta ] = None ,
5221- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5225+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
52225226 headers : Optional [Mapping [str , str ]] = None ,
52235227 ) -> NexusOperationHandle [OutputT ]: ...
52245228
@@ -5235,7 +5239,7 @@ async def start_operation(
52355239 * ,
52365240 output_type : Optional [type [OutputT ]] = None ,
52375241 schedule_to_close_timeout : Optional [timedelta ] = None ,
5238- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5242+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
52395243 headers : Optional [Mapping [str , str ]] = None ,
52405244 ) -> NexusOperationHandle [OutputT ]: ...
52415245
@@ -5247,6 +5251,7 @@ async def start_operation(
52475251 * ,
52485252 output_type : Optional [type [OutputT ]] = None ,
52495253 schedule_to_close_timeout : Optional [timedelta ] = None ,
5254+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
52505255 headers : Optional [Mapping [str , str ]] = None ,
52515256 ) -> Any :
52525257 """Start a Nexus operation and return its handle.
@@ -5276,7 +5281,7 @@ async def execute_operation(
52765281 * ,
52775282 output_type : Optional [type [OutputT ]] = None ,
52785283 schedule_to_close_timeout : Optional [timedelta ] = None ,
5279- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5284+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
52805285 headers : Optional [Mapping [str , str ]] = None ,
52815286 ) -> OutputT : ...
52825287
@@ -5290,7 +5295,7 @@ async def execute_operation(
52905295 * ,
52915296 output_type : Optional [type [OutputT ]] = None ,
52925297 schedule_to_close_timeout : Optional [timedelta ] = None ,
5293- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5298+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
52945299 headers : Optional [Mapping [str , str ]] = None ,
52955300 ) -> OutputT : ...
52965301
@@ -5307,6 +5312,7 @@ async def execute_operation(
53075312 * ,
53085313 output_type : Optional [type [OutputT ]] = None ,
53095314 schedule_to_close_timeout : Optional [timedelta ] = None ,
5315+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
53105316 headers : Optional [Mapping [str , str ]] = None ,
53115317 ) -> OutputT : ...
53125318
@@ -5323,7 +5329,7 @@ async def execute_operation(
53235329 * ,
53245330 output_type : Optional [type [OutputT ]] = None ,
53255331 schedule_to_close_timeout : Optional [timedelta ] = None ,
5326- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5332+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
53275333 headers : Optional [Mapping [str , str ]] = None ,
53285334 ) -> OutputT : ...
53295335
@@ -5340,7 +5346,7 @@ async def execute_operation(
53405346 * ,
53415347 output_type : Optional [type [OutputT ]] = None ,
53425348 schedule_to_close_timeout : Optional [timedelta ] = None ,
5343- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5349+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
53445350 headers : Optional [Mapping [str , str ]] = None ,
53455351 ) -> OutputT : ...
53465352
@@ -5352,6 +5358,7 @@ async def execute_operation(
53525358 * ,
53535359 output_type : Optional [type [OutputT ]] = None ,
53545360 schedule_to_close_timeout : Optional [timedelta ] = None ,
5361+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
53555362 headers : Optional [Mapping [str , str ]] = None ,
53565363 ) -> Any :
53575364 """Execute a Nexus operation and return its result.
@@ -5403,7 +5410,7 @@ async def start_operation(
54035410 * ,
54045411 output_type : Optional [type ] = None ,
54055412 schedule_to_close_timeout : Optional [timedelta ] = None ,
5406- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5413+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
54075414 headers : Optional [Mapping [str , str ]] = None ,
54085415 ) -> Any :
54095416 return (
@@ -5426,7 +5433,7 @@ async def execute_operation(
54265433 * ,
54275434 output_type : Optional [type ] = None ,
54285435 schedule_to_close_timeout : Optional [timedelta ] = None ,
5429- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5436+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
54305437 headers : Optional [Mapping [str , str ]] = None ,
54315438 ) -> Any :
54325439 handle = await self .start_operation (
0 commit comments