nexusrpc.handler.OperationHandler

Base class for an operation handler in a Nexus service implementation.

To define a Nexus operation handler, create a method on your service handler class that takes self and returns an instance of OperationHandler, and apply the @nexusrpc.handler.operation_handler decorator.

To create an operation handler that is limited to returning synchronously, use @nexusrpc.handler.SyncOperationHandler to create the instance of OperationHandler from the start method.

Method cancel Cancel the operation.
Method start Start the operation, completing either synchronously or asynchronously.

Start the operation, completing either synchronously or asynchronously.

Returns the result synchronously, or returns an operation token. Which path is taken may be decided at operation handling time.