@@ -69,9 +69,7 @@ def __init__(
6969 self ._fail_worker_exception_queue : asyncio .Queue [Exception ] = asyncio .Queue ()
7070
7171 async def run (self ) -> None :
72- """
73- Continually poll for Nexus tasks and dispatch to handlers.
74- """
72+ """Continually poll for Nexus tasks and dispatch to handlers."""
7573
7674 async def raise_from_exception_queue () -> NoReturn :
7775 raise await self ._fail_worker_exception_queue .get ()
@@ -160,8 +158,7 @@ async def _handle_cancel_operation_task(
160158 request : temporalio .api .nexus .v1 .CancelOperationRequest ,
161159 headers : Mapping [str , str ],
162160 ) -> None :
163- """
164- Handle a cancel operation task.
161+ """Handle a cancel operation task.
165162
166163 Attempt to execute the user cancel_operation method. Handle errors and send the
167164 task completion.
@@ -213,13 +210,11 @@ async def _handle_start_operation_task(
213210 start_request : temporalio .api .nexus .v1 .StartOperationRequest ,
214211 headers : Mapping [str , str ],
215212 ) -> None :
216- """
217- Handle a start operation task.
213+ """Handle a start operation task.
218214
219215 Attempt to execute the user start_operation method and invoke the data converter
220216 on the result. Handle errors and send the task completion.
221217 """
222-
223218 try :
224219 try :
225220 start_response = await self ._start_operation (start_request , headers )
@@ -256,8 +251,7 @@ async def _start_operation(
256251 start_request : temporalio .api .nexus .v1 .StartOperationRequest ,
257252 headers : Mapping [str , str ],
258253 ) -> temporalio .api .nexus .v1 .StartOperationResponse :
259- """
260- Invoke the Nexus handler's start_operation method and construct the StartOperationResponse.
254+ """Invoke the Nexus handler's start_operation method and construct the StartOperationResponse.
261255
262256 OperationError is handled by this function, since it results in a StartOperationResponse.
263257
@@ -326,8 +320,7 @@ async def _nexus_error_to_nexus_failure_proto(
326320 self ,
327321 error : Union [nexusrpc .HandlerError , nexusrpc .OperationError ],
328322 ) -> temporalio .api .nexus .v1 .Failure :
329- """
330- Serialize ``error`` as a Nexus Failure proto.
323+ """Serialize ``error`` as a Nexus Failure proto.
331324
332325 The Nexus Failure represents the top-level error. If there is a cause chain
333326 attached to the exception, then serialize it as the ``details``.
@@ -381,9 +374,7 @@ async def _operation_error_to_proto(
381374 async def _handler_error_to_proto (
382375 self , handler_error : nexusrpc .HandlerError
383376 ) -> temporalio .api .nexus .v1 .HandlerError :
384- """
385- Serialize ``handler_error`` as a Nexus HandlerError proto.
386- """
377+ """Serialize ``handler_error`` as a Nexus HandlerError proto."""
387378 retry_behavior = (
388379 temporalio .api .enums .v1 .NexusHandlerErrorRetryBehavior .NEXUS_HANDLER_ERROR_RETRY_BEHAVIOR_RETRYABLE
389380 if handler_error .retryable_override is True
0 commit comments