Temporal Nexus support
See https://github.com/temporalio/sdk-python/tree/main#nexus
| Package | notifications |
No package docstring; 0/1 variable, 2/4 classes, 0/1 module documented |
| Package | system |
System Nexus operation helpers. |
| Module | _decorators |
Undocumented |
| Module | _link |
No module docstring; 0/1 variable, 0/13 constant, 22/26 functions, 1/3 class documented |
| Module | _notification |
No module docstring; 0/3 type variable, 0/2 function, 1/1 class documented |
| Module | _operation |
No module docstring; 0/4 variable, 0/1 type variable, 10/19 functions, 3/4 classes documented |
| Module | _operation |
No module docstring; 1/1 function, 1/1 class documented |
| Module | _temporal |
No module docstring; 0/1 type variable, 1/1 class documented |
| Module | _token |
No module docstring; 0/1 variable, 0/2 function, 2/2 classes documented |
| Module | _util |
No module docstring; 6/8 functions documented |
From __init__.py:
| Class | |
Options for cancelling the activity backing a Nexus operation. |
| Class | |
Options for cancelling the workflow update backing a Nexus operation. |
| Class | |
Options for cancelling the workflow backing a Nexus operation. |
| Class | |
Callback that reports the outcome of a Nexus operation. |
| Class | |
Information about the running Nexus operation. |
| Class | |
Logger adapter that adds Nexus operation context information. |
| Class | |
Nexus callback to attach to events such as workflow completion. |
| Class | |
Context received by a Temporal Nexus operation when it is canceled. |
| Class | |
Nexus-aware wrapper around a Temporal Client. |
| Class | |
Operation handler for Nexus operations that interact with Temporal. Implementations override the start_operation method. |
| Class | |
Unified result: sync value or async token. |
| Class | |
Context received by a Temporal Nexus operation when it is started. |
| Class | |
A handle to a workflow that is backing a Nexus operation. |
| Class | |
Context received by a workflow run operation. |
| Function | client |
Get the Temporal client used by the worker handling the current Nexus operation. |
| Function | create |
Create a callback that reports the outcome of a standalone Nexus operation. |
| Function | in |
Whether the current code is inside a Nexus operation. |
| Function | info |
Get the current Nexus operation information. |
| Function | is |
Whether shutdown has been invoked on the worker. |
| Function | metric |
Get the metric meter for the current Nexus operation. |
| Function | temporal |
Decorator marking a method as the start method for an operation that interacts with Temporal. |
| Async Function | wait |
Asynchronously wait for shutdown to be called on the worker. |
| Function | wait |
Synchronously block while waiting for shutdown to be called on the worker. |
| Function | workflow |
Decorator marking a method as the start method for a workflow-backed operation. |
| Type Alias | |
Undocumented |
| Variable | logger |
Logger that emits additional data describing the current Nexus operation. |
str, operation: str, task_queue: str, source_context: Any) -> CompletionCallback[ Any]:nexusrpc.Operation[ notifications.OnCompleteRequest[ temporalio.common.RawValue, HandlerSourceContextT], notifications.OnCompleteResponse], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ Any]:nexusrpc.Operation[ notifications.OnCompleteRequest[ HandlerOutputT, HandlerSourceContextT], notifications.OnCompleteResponse], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ HandlerOutputT]:Callable[ [ Any, nexusrpc.handler.StartOperationContext, notifications.OnCompleteRequest[ temporalio.common.RawValue, HandlerSourceContextT]], Awaitable[ notifications.OnCompleteResponse]], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ Any]:Callable[ [ Any, nexusrpc.handler.StartOperationContext, notifications.OnCompleteRequest[ HandlerOutputT, HandlerSourceContextT]], Awaitable[ notifications.OnCompleteResponse]], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ HandlerOutputT]:Callable[ [ Any, nexusrpc.handler.StartOperationContext, notifications.OnCompleteRequest[ temporalio.common.RawValue, HandlerSourceContextT]], notifications.OnCompleteResponse], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ Any]:Callable[ [ Any, nexusrpc.handler.StartOperationContext, notifications.OnCompleteRequest[ HandlerOutputT, HandlerSourceContextT]], notifications.OnCompleteResponse], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ HandlerOutputT]:Callable[ [ Any, WorkflowRunOperationContext, notifications.OnCompleteRequest[ temporalio.common.RawValue, HandlerSourceContextT]], Awaitable[ WorkflowHandle[ notifications.OnCompleteResponse]]], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ Any]:Callable[ [ Any, WorkflowRunOperationContext, notifications.OnCompleteRequest[ HandlerOutputT, HandlerSourceContextT]], Awaitable[ WorkflowHandle[ notifications.OnCompleteResponse]]], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ HandlerOutputT]:Callable[ [ Any, TemporalStartOperationContext, TemporalNexusClient, notifications.OnCompleteRequest[ temporalio.common.RawValue, HandlerSourceContextT]], Awaitable[ TemporalOperationResult[ notifications.OnCompleteResponse]]], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ Any]:Callable[ [ Any, TemporalStartOperationContext, TemporalNexusClient, notifications.OnCompleteRequest[ HandlerOutputT, HandlerSourceContextT]], Awaitable[ TemporalOperationResult[ notifications.OnCompleteResponse]]], task_queue: str, source_context: HandlerSourceContextT) -> CompletionCallback[ HandlerOutputT]:Create a callback that reports the outcome of a standalone Nexus operation.
When the operation finishes, the server calls an on-complete operation on a worker for task_queue. The call carries the result or the failure, and source_context.
An on-complete operation takes
temporalio.nexus.notifications.OnCompleteRequest and returns
temporalio.nexus.notifications.OnCompleteResponse. The server can
deliver a callback more than once. Make the operation idempotent.
Warning
This API is experimental and unstable.
| Parameters | |
service:str | None | Service name. Required if operation is a name. Otherwise, leave it unset. |
operation:str | nexusrpc.Operation[ | Handler method, service definition operation, or operation name.
An operation name, or an operation that receives
temporalio.common.RawValue, accepts any output. |
taskstr | Task queue of the worker that runs the operation. |
sourceAny | Value that the operation receives with the outcome. |
| Returns | |
CompletionCallback[ | Callback for the completion_callbacks argument of
temporalio.client.NexusClient.start_operation. |
| Raises | |
ValueError | If operation is not an on-complete operation of a Nexus service, if service and an operation name are not given together, or if either name is empty. |
Whether shutdown has been invoked on the worker.
| Returns | |
bool | True if shutdown has been called on the worker, False otherwise. |
| Raises | |
RuntimeError | When not in a Nexus operation. |
TemporalOperationStartHandlerFunc[ NexusServiceType, InputT, OutputT]) -> TemporalOperationStartHandlerFunc[ NexusServiceType, InputT, OutputT]:str | None = None) -> Callable[ [ TemporalOperationStartHandlerFunc[ NexusServiceType, InputT, OutputT]], TemporalOperationStartHandlerFunc[ NexusServiceType, InputT, OutputT]]:Decorator marking a method as the start method for an operation that interacts with Temporal.
Warning
This API is experimental and unstable.
Asynchronously wait for shutdown to be called on the worker.
| Raises | |
RuntimeError | When not in a Nexus operation. |
Synchronously block while waiting for shutdown to be called on the worker.
This is essentially a wrapper around threading.Event.wait.
| Parameters | |
timeout:timedelta | float | None | Max amount of time to wait for shutdown to be called on the worker. |
| Raises | |
RuntimeError | When not in a Nexus operation. |
Callable[ [ NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[ WorkflowHandle[ OutputT]]]) -> Callable[ [ NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[ WorkflowHandle[ OutputT]]]:str | None = None) -> Callable[ [ Callable[ [ NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[ WorkflowHandle[ OutputT]]]], Callable[ [ NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[ WorkflowHandle[ OutputT]]]]:Decorator marking a method as the start method for a workflow-backed operation.
Undocumented
| Value |
|