class documentation

Undocumented

Method __init__ Undocumented
Async Method drain_poll_queue Undocumented
Async Method run Continually poll for Nexus tasks and dispatch to handlers.
Async Method wait_all_completed Undocumented
Async Method _handle_cancel_operation_task Handle a cancel operation task.
Async Method _handle_start_operation_task Handle a start operation task.
Async Method _handler_error_to_proto Serialize handler_error as a Nexus HandlerError proto.
Async Method _nexus_error_to_nexus_failure_proto Serialize error as a Nexus Failure proto.
Async Method _operation_error_to_proto Undocumented
Async Method _start_operation Invoke the Nexus handler's start_operation method and construct the StartOperationResponse.
Instance Variable _bridge_worker Undocumented
Instance Variable _client Undocumented
Instance Variable _data_converter Undocumented
Instance Variable _fail_worker_exception_queue Undocumented
Instance Variable _handler Undocumented
Instance Variable _interceptors Undocumented
Instance Variable _metric_meter Undocumented
Instance Variable _running_tasks Undocumented
Instance Variable _task_queue Undocumented
def __init__(self, *, bridge_worker: Callable[[], temporalio.bridge.worker.Worker], client: temporalio.client.Client, task_queue: str, service_handlers: Sequence[Any], data_converter: temporalio.converter.DataConverter, interceptors: Sequence[Interceptor], metric_meter: temporalio.common.MetricMeter, executor: concurrent.futures.Executor | None): (source)

Undocumented

async def drain_poll_queue(self): (source)

Undocumented

async def run(self): (source)

Continually poll for Nexus tasks and dispatch to handlers.

async def wait_all_completed(self): (source)

Undocumented

async def _handle_cancel_operation_task(self, task_token: bytes, request: temporalio.api.nexus.v1.CancelOperationRequest, headers: Mapping[str, str]): (source)

Handle a cancel operation task.

Attempt to execute the user cancel_operation method. Handle errors and send the task completion.

async def _handle_start_operation_task(self, task_token: bytes, start_request: temporalio.api.nexus.v1.StartOperationRequest, headers: Mapping[str, str]): (source)

Handle a start operation task.

Attempt to execute the user start_operation method and invoke the data converter on the result. Handle errors and send the task completion.

async def _handler_error_to_proto(self, handler_error: nexusrpc.HandlerError) -> temporalio.api.nexus.v1.HandlerError: (source)

Serialize handler_error as a Nexus HandlerError proto.

async def _nexus_error_to_nexus_failure_proto(self, error: nexusrpc.HandlerError | nexusrpc.OperationError) -> temporalio.api.nexus.v1.Failure: (source)

Serialize error as a Nexus Failure proto.

The Nexus Failure represents the top-level error. If there is a cause chain attached to the exception, then serialize it as the details.

Notice that any stack trace attached to error itself is not included in the result.

See https://github.com/nexus-rpc/api/blob/main/SPEC.md#failure

async def _operation_error_to_proto(self, err: nexusrpc.OperationError) -> temporalio.api.nexus.v1.UnsuccessfulOperationError: (source)

Undocumented

Invoke the Nexus handler's start_operation method and construct the StartOperationResponse.

OperationError is handled by this function, since it results in a StartOperationResponse.

All other exceptions are handled by a caller of this function.

_bridge_worker = (source)

Undocumented

Undocumented

_data_converter = (source)

Undocumented

_fail_worker_exception_queue: asyncio.Queue[Exception] = (source)

Undocumented

_handler = (source)

Undocumented

_interceptors = (source)

Undocumented

_metric_meter = (source)

Undocumented

Undocumented

_task_queue = (source)

Undocumented