package documentation
Module _decorators Undocumented
Module _link_conversion No module docstring; 0/1 variable, 0/9 constant, 11/13 functions, 0/1 class documented
Module _operation_context No module docstring; 0/3 variable, 0/1 type variable, 0/5 function, 2/3 classes documented
Module _operation_handlers No module docstring; 1/1 function, 1/1 class documented
Module _temporal_client 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 CancelWorkflowRunOptions Options for cancelling the workflow backing a Nexus operation.
Class Info Information about the running Nexus operation.
Class LoggerAdapter Logger adapter that adds Nexus operation context information.
Class NexusCallback Nexus callback to attach to events such as workflow completion.
Class TemporalCancelOperationContext Context received by a Temporal Nexus operation when it is canceled.
Class TemporalNexusClient Nexus-aware wrapper around a Temporal Client.
Class TemporalOperationHandler Operation handler for Nexus operations that interact with Temporal. Implementations override the start_operation method.
Class TemporalOperationResult Unified result: sync value or async token.
Class TemporalStartOperationContext Context received by a Temporal Nexus operation when it is started.
Class WorkflowHandle A handle to a workflow that is backing a Nexus operation.
Class WorkflowRunOperationContext Context received by a workflow run operation.
Function client Get the Temporal client used by the worker handling the current Nexus operation.
Function in_operation Whether the current code is inside a Nexus operation.
Function info Get the current Nexus operation information.
Function is_worker_shutdown Whether shutdown has been invoked on the worker.
Function metric_meter Get the metric meter for the current Nexus operation.
Function temporal_operation Decorator marking a method as the start method for an operation that interacts with Temporal.
Async Function wait_for_worker_shutdown Asynchronously wait for shutdown to be called on the worker.
Function wait_for_worker_shutdown_sync Synchronously block while waiting for shutdown to be called on the worker.
Function workflow_run_operation Decorator marking a method as the start method for a workflow-backed operation.
Type Alias TemporalOperationStartHandlerFunc Undocumented
Variable logger Logger that emits additional data describing the current Nexus operation.

Get the Temporal client used by the worker handling the current Nexus operation.

def in_operation() -> bool: (source)

Whether the current code is inside a Nexus operation.

def info() -> Info: (source)

Get the current Nexus operation information.

def is_worker_shutdown() -> bool: (source)

Whether shutdown has been invoked on the worker.

Returns
boolTrue if shutdown has been called on the worker, False otherwise.
Raises
RuntimeErrorWhen not in a Nexus operation.

Get the metric meter for the current Nexus operation.

@overload
def temporal_operation(start: TemporalOperationStartHandlerFunc[NexusServiceType, InputT, OutputT]) -> TemporalOperationStartHandlerFunc[NexusServiceType, InputT, OutputT]:
@overload
def temporal_operation(*, name: str | None = None) -> Callable[[TemporalOperationStartHandlerFunc[NexusServiceType, InputT, OutputT]], TemporalOperationStartHandlerFunc[NexusServiceType, InputT, OutputT]]:
(source)

Decorator marking a method as the start method for an operation that interacts with Temporal.

Warning

This API is experimental and unstable.

async def wait_for_worker_shutdown(): (source)

Asynchronously wait for shutdown to be called on the worker.

Raises
RuntimeErrorWhen not in a Nexus operation.
def wait_for_worker_shutdown_sync(timeout: timedelta | float | None = None): (source)

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 | NoneMax amount of time to wait for shutdown to be called on the worker.
Raises
RuntimeErrorWhen not in a Nexus operation.
@overload
def workflow_run_operation(start: Callable[[NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[WorkflowHandle[OutputT]]]) -> Callable[[NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[WorkflowHandle[OutputT]]]:
@overload
def workflow_run_operation(*, name: str | None = None) -> Callable[[Callable[[NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[WorkflowHandle[OutputT]]]], Callable[[NexusServiceType, WorkflowRunOperationContext, InputT], Awaitable[WorkflowHandle[OutputT]]]]:
(source)

Decorator marking a method as the start method for a workflow-backed operation.

TemporalOperationStartHandlerFunc: TypeAlias = (source)

Undocumented

Value
Callable[[NexusServiceType,
          TemporalStartOperationContext,
          TemporalNexusClient,
          InputT],
         Awaitable[TemporalOperationResult[OutputT]]]

Logger that emits additional data describing the current Nexus operation.