nexusrpc.handler.MiddlewareSafeOperationHandler
class documentation
class MiddlewareSafeOperationHandler(OperationHandler[
Known subclasses: nexusrpc.handler._core._EnsuredAwaitableOperationHandler
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.
Warning
This API is experimental and may change in the future.
| 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):
¶
overrides nexusrpc.handler.OperationHandler.cancel
overridden in nexusrpc.handler._core._EnsuredAwaitableOperationHandler
Cancel an in progress operation identified by the given token.
@abstractmethod
async def start(self, ctx: StartOperationContext, input: Any) -> StartOperationResultSync[:
¶
overrides nexusrpc.handler.OperationHandler.start
overridden in nexusrpc.handler._core._EnsuredAwaitableOperationHandler
Start the operation and return it's result or an async token.