@@ -5119,25 +5119,29 @@ def _to_proto(self) -> temporalio.bridge.proto.common.VersioningIntent.ValueType
5119
5119
5120
5120
5121
5121
class 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
+ """
5124
5128
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."""
5127
5131
5128
5132
ABANDON = 1
5129
- """Do not request cancellation of the nexus operation if already scheduled ."""
5133
+ """Do not request cancellation of the operation."""
5130
5134
5131
5135
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
+ """
5137
5140
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
+ """
5141
5145
5142
5146
5143
5147
class NexusClient (ABC , Generic [ServiceT ]):
@@ -5170,7 +5174,7 @@ async def start_operation(
5170
5174
* ,
5171
5175
output_type : Optional [type [OutputT ]] = None ,
5172
5176
schedule_to_close_timeout : Optional [timedelta ] = None ,
5173
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5177
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5174
5178
headers : Optional [Mapping [str , str ]] = None ,
5175
5179
) -> NexusOperationHandle [OutputT ]: ...
5176
5180
@@ -5184,7 +5188,7 @@ async def start_operation(
5184
5188
* ,
5185
5189
output_type : Optional [type [OutputT ]] = None ,
5186
5190
schedule_to_close_timeout : Optional [timedelta ] = None ,
5187
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5191
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5188
5192
headers : Optional [Mapping [str , str ]] = None ,
5189
5193
) -> NexusOperationHandle [OutputT ]: ...
5190
5194
@@ -5201,7 +5205,7 @@ async def start_operation(
5201
5205
* ,
5202
5206
output_type : Optional [type [OutputT ]] = None ,
5203
5207
schedule_to_close_timeout : Optional [timedelta ] = None ,
5204
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5208
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5205
5209
headers : Optional [Mapping [str , str ]] = None ,
5206
5210
) -> NexusOperationHandle [OutputT ]: ...
5207
5211
@@ -5218,7 +5222,7 @@ async def start_operation(
5218
5222
* ,
5219
5223
output_type : Optional [type [OutputT ]] = None ,
5220
5224
schedule_to_close_timeout : Optional [timedelta ] = None ,
5221
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5225
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5222
5226
headers : Optional [Mapping [str , str ]] = None ,
5223
5227
) -> NexusOperationHandle [OutputT ]: ...
5224
5228
@@ -5235,7 +5239,7 @@ async def start_operation(
5235
5239
* ,
5236
5240
output_type : Optional [type [OutputT ]] = None ,
5237
5241
schedule_to_close_timeout : Optional [timedelta ] = None ,
5238
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5242
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5239
5243
headers : Optional [Mapping [str , str ]] = None ,
5240
5244
) -> NexusOperationHandle [OutputT ]: ...
5241
5245
@@ -5247,6 +5251,7 @@ async def start_operation(
5247
5251
* ,
5248
5252
output_type : Optional [type [OutputT ]] = None ,
5249
5253
schedule_to_close_timeout : Optional [timedelta ] = None ,
5254
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5250
5255
headers : Optional [Mapping [str , str ]] = None ,
5251
5256
) -> Any :
5252
5257
"""Start a Nexus operation and return its handle.
@@ -5276,7 +5281,7 @@ async def execute_operation(
5276
5281
* ,
5277
5282
output_type : Optional [type [OutputT ]] = None ,
5278
5283
schedule_to_close_timeout : Optional [timedelta ] = None ,
5279
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5284
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5280
5285
headers : Optional [Mapping [str , str ]] = None ,
5281
5286
) -> OutputT : ...
5282
5287
@@ -5290,7 +5295,7 @@ async def execute_operation(
5290
5295
* ,
5291
5296
output_type : Optional [type [OutputT ]] = None ,
5292
5297
schedule_to_close_timeout : Optional [timedelta ] = None ,
5293
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5298
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5294
5299
headers : Optional [Mapping [str , str ]] = None ,
5295
5300
) -> OutputT : ...
5296
5301
@@ -5307,6 +5312,7 @@ async def execute_operation(
5307
5312
* ,
5308
5313
output_type : Optional [type [OutputT ]] = None ,
5309
5314
schedule_to_close_timeout : Optional [timedelta ] = None ,
5315
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5310
5316
headers : Optional [Mapping [str , str ]] = None ,
5311
5317
) -> OutputT : ...
5312
5318
@@ -5323,7 +5329,7 @@ async def execute_operation(
5323
5329
* ,
5324
5330
output_type : Optional [type [OutputT ]] = None ,
5325
5331
schedule_to_close_timeout : Optional [timedelta ] = None ,
5326
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5332
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5327
5333
headers : Optional [Mapping [str , str ]] = None ,
5328
5334
) -> OutputT : ...
5329
5335
@@ -5340,7 +5346,7 @@ async def execute_operation(
5340
5346
* ,
5341
5347
output_type : Optional [type [OutputT ]] = None ,
5342
5348
schedule_to_close_timeout : Optional [timedelta ] = None ,
5343
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5349
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5344
5350
headers : Optional [Mapping [str , str ]] = None ,
5345
5351
) -> OutputT : ...
5346
5352
@@ -5352,6 +5358,7 @@ async def execute_operation(
5352
5358
* ,
5353
5359
output_type : Optional [type [OutputT ]] = None ,
5354
5360
schedule_to_close_timeout : Optional [timedelta ] = None ,
5361
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5355
5362
headers : Optional [Mapping [str , str ]] = None ,
5356
5363
) -> Any :
5357
5364
"""Execute a Nexus operation and return its result.
@@ -5403,7 +5410,7 @@ async def start_operation(
5403
5410
* ,
5404
5411
output_type : Optional [type ] = None ,
5405
5412
schedule_to_close_timeout : Optional [timedelta ] = None ,
5406
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5413
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5407
5414
headers : Optional [Mapping [str , str ]] = None ,
5408
5415
) -> Any :
5409
5416
return (
@@ -5426,7 +5433,7 @@ async def execute_operation(
5426
5433
* ,
5427
5434
output_type : Optional [type ] = None ,
5428
5435
schedule_to_close_timeout : Optional [timedelta ] = None ,
5429
- cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_CANCELLATION_COMPLETED ,
5436
+ cancellation_type : NexusOperationCancellationType = NexusOperationCancellationType .WAIT_COMPLETED ,
5430
5437
headers : Optional [Mapping [str , str ]] = None ,
5431
5438
) -> Any :
5432
5439
handle = await self .start_operation (
0 commit comments