class documentation

class MiddlewareSafeOperationHandler(OperationHandler[Any, Any], ABC):

Known subclasses: nexusrpc.handler._core._EnsuredAwaitableOperationHandler

View In Hierarchy

An OperationHandler where start and cancel can be awaited by an async runtime. It can produce a result synchronously by returning StartOperationResultSync or asynchronously by returning StartOperationResultAsync in the same fashion that OperationHandler does.

Async Method cancel Cancel an in progress operation identified by the given token.
Async Method start Start the operation and return it's result or an async token.
@abstractmethod
async def cancel(self, ctx: CancelOperationContext, token: str):

Cancel an in progress operation identified by the given token.

@abstractmethod
async def start(self, ctx: StartOperationContext, input: Any) -> StartOperationResultSync[Any] | StartOperationResultAsync:

Start the operation and return it's result or an async token.